注意:我知道
是演示性的,而
和
盲目地这样做?很多人认为
不符合网络标准,因此他们转换每个 < /code> 到
在网站重新设计、内容重新填充、新网站设计时,人们向其他人建议这一点,
Dreamweaver 也提供了转换所有 的选项。 ;
和
到
和
在设计视图中粘贴代码时以及当我们 人盲目使用。
使用 B 和 I哪些 Shup/280420/1101118332-My-Desktop.png
和 Dreamweaver(如果选中上述选项)和许多在线所见即所得编辑器以
和 提供输出;
而按钮显示 B 和 I。
替代文本 http://shup.com/Shup/280425/1101118921-My-Desktop .png
在我看来,它造成了对
和
的误解,
当我们从客户端获取内容时,我们不知道在哪里客户想要强调,并且他只想使用粗体文本进行演示。在这种情况下我们应该怎么办?没有人有时间来决定每个实例(我们和客户)是否应该是
还是
、
或
转换每个
和
的优缺点是什么如果我们说我们的网站是可访问的,那么盲目地将 code> 转换为
和
?
更新:记住< ;b>
和
并未弃用,它们在 HTML 5 规范中
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
发布评论
评论(9)
正如其他人提到的,使用
、
、
等添加了语义。这很重要,因为您说出了为什么要强调某些内容并增加 html 的可读性,因为您知道为什么它是粗体的。
此外,屏幕阅读器使用强标签在大声朗读时产生听觉上的差异。
也许您可以考虑将音频表示作为指导。例如,如果您希望在朗读时有所不同,请将其标记为
。如果没有,请使用
。
然后是渲染问题:我实际上不知道是否所有浏览器都会将
渲染为粗体以及是否会保持这种状态。
简而言之:
否
。
As others have mentioned, using
<strong>
,<em>
,<cite>
etc. adds semantics. This is important because you say something about why you want to emphasize something and increase the readability of your html, because you know why it's 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, for instance, mark it as
<strong>
. If not, use<b>
.Then there is the issue of rendering: I don't actually know if all browsers will render a
<strong>
as bold and if it will stay that way.So in short:
<strong>
No</strong>
.不。
引用 Anne van Kesteren (来源):
当然,他是对的。
strong
和b
不同。em
和i
不一样。如果您想向文本添加语义强调,请仅使用strong
/em
。No.
To quote Anne van Kesteren (source):
And he’s right, of course.
strong
andb
are not the same.em
andi
are not the same. Only usestrong
/em
if you want to add semantical emphasis to text.、
、
是严格印刷的。
我所说的印刷并不是指视觉。我的意思是通过外观表达的语义。
他们需要额外的上下文才能具有特定的含义(例如定义,例如:
或依赖于印刷惯例,例如粗体文本引人注目,斜体文本意味着上下文更改)。在印刷惯例中,粗体和斜体是某种括号嵌套。
例如这个有另一个上下文
这些标签是传统印刷版式的端口,其中语义由特定的视觉呈现承载。
正如您所指出的,它们被认为已被弃用,但在 XHTML5 中并非如此。为什么?我认为,主要是网络内容不仅仅适用于电子媒体。如果您打印 Web 文档,这些标签可能会替换
TeX
中使用的某些表达式的语法。和
严格用于语义,
告诉文本应该如何阅读和强调。
回顾一下,这些标签的含义都不一样,因此它们甚至不应该使用,但不能互换使用,也不能被替换。尤其是盲目的。
AFIR,Dreamweaver 并不是 WYSIWYM 编辑器的典范。我一直认为它是下一代 FrontPage 思维(易于使用并立即完成工作,而忘记未来和可扩展性)。
所以我理解这里的惊喜,你的误解是正确的:)
<b>
,<i>
,<tt>
are strictly typographical.By saying typographical, I don't mean visual. I mean semantics expressed by the look.
They need additional context to have specific meaning (eg. definition, like:
or relying on typographic convention, like that the text in bold are eye-catchers and the italics mean context change). In typographical conventions bolds and italics are some kind of parenthesis nesting.
for example this one has another context
These tags are the port of traditional, printed typography, in which semantics is carried by the specific visual presentation.
As you pointed out, they are considered to be deprecated, but not in XHTML5. Why? I think, mostly that the web content is not only for the e-media. If you print web document, these tags may replace the syntax of some expressions used for example in
TeX
.<strong>
and<em>
are strictly for semantics,telling how the text should be read and emphasized.
So to recap, none of these tag means the same as other, so they not even should not be used, but may not be used interchangeably, nor substituted. In particular, blindly.
AFIR, Dreamweaver is not the model of the WYSIWYM editor. I have always considered it to be next generation of FrontPage thinking (ease of use and getting things done now, and forget about the future and scalability).
So I understand the surprise here, and your misconception feeling is right :)
我们不应该盲目地交换
b
和strong
,因为它们有不同的预期用途。<代码>>根据 HTML5 规范,
不是表示元素。它们有不同的含义和目的。引用 HTML5 规范,
对于
i
元素,正如其他人已经很好地阐明的那样,
i
和em
不能互换使用,b
和strong
也是如此>。i
和b
用于其预期目的的情况非常罕见。 (例如,在对话脚本、论文、简历中)参考文献:
We shouldn't swap
b
andstrong
blindly as they have different intended purpose.<b
> and<i>
are not presentational elements as per the HTML5 spec. They have a different meaning and purpose. Quoting the HTML5 specs,and for the
i
element,As others have very well clarified,
i
andem
cannot be used interchangeably and so is the case withb
andstrong
.The usage of
i
andb
for their intended purpose is very rare. (eg. in dialogue scripts, thesis, resumes)References:
如果您只想使用粗体文本,请通过 css 将其设置为粗体。如果“粗体”字体粗细没有语义意义,则不应使用
或
。但是,您不应该使用
或
因为它们是非语义的(实际上它们是字体样式标签)并且它们的用途因此即使没有弃用,也不鼓励。
If you just want to use bold text, make it bold via css. If the "bold" font weight has no semantical meaning, you should not use
<strong>
or<em>
for it. However, you shouldn't use<b>
or<i>
either because these are non-semantic (in fact they are font-style tags) and their use is thus discouraged if not even deprecated.和
不一定相同。您建议的
是为了更加强调,而
仅用于样式目的。所以你不应该盲目地切换它们。
有些人会说
标签已被弃用,但事实并非如此。它仍然活跃。然而;正如您所说,它不是很语义化,因此使用
并设置其样式可能是更好的选择。
<b>
and<strong>
are not necessarily the same.<strong>
as you suggested are for higher emphasis, while<b>
are for styling purposes only. So you should not switch them blindly.Some people will say that the
<b>
tag is being deprecated, but it's not. It's still alive and kicking. However; it is not very semantic, as you're saying, so it might be a better option to use a<span>
and style it.正如其他人所说,strong/b 和 i/em 之间存在语义差异。特别是,屏幕阅读器会使用它们来访问您网站的视障人士。对于他们来说,如果您只是将一些文本设置为粗体,或者如果您想在网站上所说的内容中添加某种强调,则会产生巨大的差异。所以一定要仔细考虑使用 B 或 STRONG 来制作大胆的东西。 EM 和 I 也是如此。
As others have said there's a semantic difference between strong/b and i/em. Especially they are used by screenreaders for visually impaired people visiting your website. For them it makes a huge difference if you just make some text bold-face, or if you want to add some kind of EMphasis to what you're saying on your website. So be sure to carefully consider making something bold using B or STRONG. The same goes for EM and I.
这里已经有一些很好的答案,但是对于那些仍然不太理解并且需要进一步解释和示例的人,我在 HTML 文本,Web 平台文档 教程。该教程在页面的中间部分解释了
和
之间的使用差异,并给出了示例。
There are some great answers here already, but for those of you that still don't quite understand and need a further explanation and example, I found a useful explanation of this in the HTML Text, Web Platform Docs tutorial. The tutorial explains the difference in use between
<strong>
and<b>
a little past halfway down the page and gives examples.了解
-
和
-
< 之间的区别/code> 标签,你需要明白该标签用于简单地突出显示文本,而
定义了突出显示文本的含义。同样,对于
和
标签: 差异示例是视障人士使用的操作系统设置。当启用“语音”文本阅读时,单词将通过
和
标签的语调突出显示。
To understand the difference between the
<b>
-<strong>
and<i>
-<em>
tags, you need to understand that the tag is used to simply highlight text, while<strong>
defines the meaning of the highlighted text. Likewise with the<i>
and<em>
tags: an example of the difference is the OS settings used by the visually impaired. When the reading of texts with the "speech" is enabled, the words will be highlighted by the intonation of the<strong>
and<em>
tags.