可以使用< strong>代替< b>盲目? [英] Is it ok to use <strong> in place of <b> blindly?

查看:453
本文介绍了可以使用< strong>代替< b>盲目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

注意:我知道< b> 是呈现方式,< span style =font-weight:大胆> 是一种更好的方式,并且< strong> < em> 是为了强调,但我的问题是不是这个。






我们是否应该转换每个< b> ; < strong> ?许多人这样做,他们认为< b> 不符合网站标准,因此他们在网站上将每个< b> 转换为< strong> 重新设计,内容重新填充,新的网站设计和人们也向其他人提出这个建议。




Dreamweaver也给出了选项将所有< b> < i> 转换为< strong> / code>和< em> 在设计视图中的代码粘贴以及我们使用B和I时盲目使用哪些人。



alt text http://shup.com/Shup/280420/1101118332-My-Desktop.png



和Dreamweaver (如果上面的选项被选中),许多在线所见即所得的编辑器会在< strong> < em> 而按钮显示 B

替代文字http://shup.com/Shup/280425/1101118921-My-Desktop.png



我认为这是对< strong> < b>






当我们从客户那里获得内容时,我们不知道客户想要强调哪些内容,想要使用粗体文本用于演示目的。我们应该在这种情况下做什么?没有人有时间来决定每个实例(我们和客户)是否应该是< b> < strong> ; < i> < em>



转换每个< b> < i> 转换为< strong> < em> / p>




更新:记住 < b> < i> / code>不被弃用,它们在HTML 5规范中

解决方案

code>< strong < em> < cite> 等增加语义,这很重要,因为你说了一些关于你为什么要强调某些东西,并增加了你的html的可读性,因为你知道为什么它的粗体。



此外,屏幕阅读器使用强大的标签在大声朗读时发出声音差异。 可能你可以以音频代表为例指导。如果您在朗读时想要有所不同,请将其标记为< strong> ,例如,如果不使用< b>

然后出现渲染问题:我实际上并不知道所有浏览器是否会呈现< strong> 作为一个粗体,如果它将保持这种方式。



所以简而言之:< strong> < / strong>


Note: I know <b> is presentational and <span style="font-weight:bold> is a better way, and <strong> and <em> are for emphasis but my question is not regarding this.


Should we convert every <b> to <strong> blindly? Many people do this, they think <b> is not good as per web standards so they convert every <b> to <strong> upon site redesign, content re-population, new site design and people suggest this to others also.


Dreamweaver has also given the option to convert all <b> and <i> to <strong> and <em> on code paste in design view and when we use B and I Which people use blindly.

alt text http://shup.com/Shup/280420/1101118332-My-Desktop.png

And Dreamweaver (if above option is checked) and many online WYSIWYG editor give output in <strong> and <em> while button shows B and I.

alt text http://shup.com/Shup/280425/1101118921-My-Desktop.png

In my opinion it's creating a misconception about <strong> and <b>


When we get content from a client we don't know where the client wants to give emphasize and where he just wants to use bold text for presentation purposes. What should we do in this circumstance? No one has the time to give to decide for each instance (us and the client), whether it should be <b> or <strong>, <i> or <em>

What are the pros and cons to convert every <b> and <i> into <strong> and <em> blindly if we are saying our site is accessible?


Update: remember <b> and <i> are not deprecated they are in HTML 5 specification

解决方案

As others have mentioned using <strong>, <em>, <cite> etc. adds semantics, and this is important because you say something about why you want to emphasize something, and increases the readability of your html, because you know why its in bold.

Furthermore screen readers use the strong tags to make an audible difference when reading it aloud.

Maybe you could think about the audio represenation as a guide. If you would want a difference when read aloud, mark it as <strong> for instance, if not use <b>.

Then there is the issue of rendering: I don't actually know if all browsers will render a <strong> as a bold and if it will stay that way.

So in short: <strong>No</strong>.

这篇关于可以使用&lt; strong&gt;代替&lt; b&gt;盲目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆