如果我们要制作可访问的网站,我们不应该使用微格式吗?

发布于 2024-08-20 07:40:49 字数 1616 浏览 5 评论 0 原文

微格式的类结构适合屏幕阅读器吗?

<div class="vcard">
  <span class="fn">Gregory Peck</span>
  <a class="org url" href="http://www.commerce.net/">CommerceNet</a>
  <div class="adr">
    <span class="type">Work</span>:
    <div class="street-address">169 University Avenue</div>
    <span class="locality">Palo Alto</span>,  
    <abbr class="region" title="California">CA</abbr>  
    <span class="postal-code">94301</span>
    <div class="country-name">USA</div>
  </div>
  <div class="tel">
   <span class="type">Work</span> +1-650-289-4040
  </div>
  <div class="tel">
    <span class="type">Fax</span> +1-650-289-4041
  </div>
  <div>Email:
   <span class="email">[email protected]</span>
  </div>
</div>

和这个(假设两个代码具有相同的内容信息)

<p><strong>London</strong>
<br/>
607,5th Floor, Oxford Towers,
<br/>
Airport Road, Kodihalli
<br/>
London 560 008
<br/>
Phone: 91-80- 4115 1705-706
<br/>
Fax: 91-80- 41151707
<br/>
Email:<a href="mailto:[email protected]"></a>
<br/>
Website:<a href="http://abc.com">abc.com</a>
</p>

哪种方法适合可访问性和纯文本浏览器?这两种方法的屏幕阅读器将如何表现?

Is microformat's classes structure good for Screen reader?

<div class="vcard">
  <span class="fn">Gregory Peck</span>
  <a class="org url" href="http://www.commerce.net/">CommerceNet</a>
  <div class="adr">
    <span class="type">Work</span>:
    <div class="street-address">169 University Avenue</div>
    <span class="locality">Palo Alto</span>,  
    <abbr class="region" title="California">CA</abbr>  
    <span class="postal-code">94301</span>
    <div class="country-name">USA</div>
  </div>
  <div class="tel">
   <span class="type">Work</span> +1-650-289-4040
  </div>
  <div class="tel">
    <span class="type">Fax</span> +1-650-289-4041
  </div>
  <div>Email:
   <span class="email">[email protected]</span>
  </div>
</div>

and this (assume both code with same content info)

<p><strong>London</strong>
<br/>
607,5th Floor, Oxford Towers,
<br/>
Airport Road, Kodihalli
<br/>
London 560 008
<br/>
Phone: 91-80- 4115 1705-706
<br/>
Fax: 91-80- 41151707
<br/>
Email:<a href="mailto:[email protected]"></a>
<br/>
Website:<a href="http://abc.com">abc.com</a>
</p>

Which method is good for accessibility and text only browser? How screen reader will behave with both method?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

jJeQQOZ5 2024-08-27 07:40:49

微格式与演示无关,

foo 渲染与 foo 相同,这就是所有微格式的意义:将标准化的类名添加到 HTML 元素中,用于给定和标识的“事物”(例如人,例如:hcard),仅此而已。

Microformats are not about presentational, they are about semantics.

<span>foo</span> renders the same as <span class="bar">foo</span>, and this is all microformats are about : adding standardized class names to HTML elements for a given and identified "thing" (like a person, eg: hcard), nothing more.

何以心动 2024-08-27 07:40:49

我认为还没有任何屏幕阅读器使用微格式,但微格式不会伤害屏幕阅读器用户(日期时间设计模式除外)。

请注意,微格式通常只指定类名,因此您不必仅将

与微格式一起使用 - 段落和列表等等,在适当的情况下都可以。

I don’t think any screen readers make any use of microformats yet, but microformats don’t hurt screen reader users (except for the datetime design pattern) either.

Please note that microformats generally only specify class names, so you don’t have to just use <div>s and <span>s with microformats — paragraphs and lists and whatnot are just fine, where appropriate.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文