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

问题描述

注意:我知道 是展示性的, 更好方式, 是为了强调,但我的问题与此无关.

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.

我们是否应该盲目地将每个转换为?许多人这样做,他们认为 不符合 Web 标准,因此他们将每个 转换为 code> 在网站重新设计、内容重新填充、新网站设计以及人们也向其他人建议时.

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 还提供了将所有 转换为 的选项><em> 在设计视图中的代码粘贴以及我们何时使用 B 和 I 哪些人盲目使用.

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.

替代文字 http://shup.com/Shup/280420/1101118332-我的桌面.png

和 Dreamweaver(如果选中上述选项)和许多在线 WYSIWYG 编辑器在 中输出,而按钮显示 B.

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

替代文字 http://shup.com/Shup/280425/1101118921-我的桌面.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>

将每个转换成的优缺点是什么><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?

更新:记住<b> 没有被弃用,它们在 HTML 5 规范中

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

推荐答案

正如其他人提到的使用 >、<cite> 等添加了语义,这很重要,因为您说出了为什么要强调某事的原因,并增加了 html 的可读性,因为您知道为什么以粗体显示.

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>.

然后是渲染问题:我实际上不知道是否所有浏览器都会将 <strong> 渲染为粗体,以及是否会保持这种状态.

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;盲目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-12 00:03