使用可以吗?代替 盲目地?

发布于 2024-08-21 06:10:48 字数 1765 浏览 4 评论 0 原文

注意:我知道 是演示性的,而


盲目地这样做?很多人认为 不符合网络标准,因此他们转换每个 < /code> 到 在网站重新设计、内容重新填充、新网站设计时,人们向其他人建议这一点,


Dreamweaver 也提供了转换所有 的选项。 ; 在设计视图中粘贴代码时以及当我们 人盲目使用。

使用 B 和 I哪些 Shup/280420/1101118332-My-Desktop.png

和 Dreamweaver(如果选中上述选项)和许多在线所见即所得编辑器以 提供输出; 而按钮显示 BI

替代文本 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

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

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

发布评论

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

评论(9

一指流沙 2024-08-28 06:10:48

正如其他人提到的,使用 等添加了语义。这很重要,因为您说出了为什么要强调某些内容并增加 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>.

独﹏钓一江月 2024-08-28 06:10:48

可以盲目地使用代替吗?


不。

引用 Anne van Kesteren (来源):

让我给出一些相互矛盾的建议。请将 em 替换为 i,将 strong 替换为 b。由此产生的标记可能更准确。特别是对于所见即所得的软件,它们极不可能被正确使用,而且因为人们普遍认为它们是可以互换的,唯一的区别是strongem语义上发生了很多误用。如有疑问,请使用 ib

当然,他是对的。 strongb 不同。 emi 不一样。如果您想向文本添加语义强调,请仅使用 strong / em

Is it ok to use <strong> in place of <b> blindly?

No.

To quote Anne van Kesteren (source):

Let me give some contradictory advice. Please do replace em with i and strong with b. The resulting markup is likely more accurate. Especially with WYSIWYG software it is extremely unlikely they will be used correctly, but also because the notion spread that they are interchangeable with the sole difference being that strong and em are semantic a lot of misuse happened. When in doubt, use i and b.

And he’s right, of course. strong and b are not the same. em and i are not the same. Only use strong / em if you want to add semantical emphasis to text.

壹場煙雨 2024-08-28 06:10:48

是严格印刷的。

我所说的印刷并不是指视觉。我的意思是通过外观表达的语义。
他们需要额外的上下文才能具有特定的含义(例如定义,例如:

  • 斜体文本取自...

或依赖于印刷惯例,例如粗体文本引人注目,斜体文本意味着上下文更改)。在印刷惯例中,粗体和斜体是某种括号嵌套。

(for example [this one has another context])

例如这个有另一个上下文

这些标签是传统印刷版式的端口,其中语义由特定的视觉呈现承载。

正如您所指出的,它们被认为已被弃用,但在 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:

  • text in italics were taken from ...

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])

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 :)

梦幻之岛 2024-08-28 06:10:48

我们不应该盲目地交换 bstrong,因为它们有不同的预期用途。

<代码>>根据 HTML5 规范, 不是表示元素。它们有不同的含义和目的。引用 HTML5 规范,

b 元素表示要进行风格偏移的文本范围
来自普通散文,没有传达任何额外的重要性,例如
文档摘要中的关键词、评论中的产品名称或其他
典型的排版呈现方式为粗体的文本跨度。

对于 i 元素,

i 元素代表不同语气或语气的一段文本,
或者以其他方式偏离正常的散文,例如分类学
名称、技术术语、另一个惯用短语
语言、思想、船名或其他一些具有典型特征的散文
排版呈现为斜体。

正如其他人已经很好地阐明的那样,iem 不能互换使用,bstrong 也是如此>。

ib 用于其预期目的的情况非常罕见。 (例如,在对话脚本、论文、简历中)


参考文献:

  1. http://html5doctor.com/ib -em-strong-element/
  2. http://www.whatwg.org/specs/web-apps/current-work/multipage/text-level-semantics.html#the-i-element

We shouldn't swap b and strong 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,

The b element represents a span of text to be stylistically offset
from the normal prose without conveying any extra importance, such as
key words in a document abstract, product names in a review, or other
spans of text whose typical typographic presentation is boldened.

and for the i element,

The i element represents a span of text in an alternate voice or mood,
or otherwise offset from the normal prose, such as a taxonomic
designation, a technical term, an idiomatic phrase from another
language, a thought, a ship name, or some other prose whose typical
typographic presentation is italicized.

As others have very well clarified, i and em cannot be used interchangeably and so is the case with b and strong.

The usage of i and b for their intended purpose is very rare. (eg. in dialogue scripts, thesis, resumes)


References:

  1. http://html5doctor.com/i-b-em-strong-element/
  2. http://www.whatwg.org/specs/web-apps/current-work/multipage/text-level-semantics.html#the-i-element
ぽ尐不点ル 2024-08-28 06:10:48

如果您只想使用粗体文本,请通过 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.

勿忘心安 2024-08-28 06:10:48

不一定相同。您建议的 是为了更加强调,而 仅用于样式目的。所以你不应该盲目地切换它们。

有些人会说 标签已被弃用,但事实并非如此。它仍然活跃。然而;正如您所说,它不是很语义化,因此使用 并设置其样式可能是更好的选择。

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

傲影 2024-08-28 06:10:48

正如其他人所说,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.

壹場煙雨 2024-08-28 06:10:48

这里已经有一些很好的答案,但是对于那些仍然不太理解并且需要进一步解释和示例的人,我在 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.

眼眸里的那抹悲凉 2024-08-28 06:10:48

了解 - - < 之间的区别/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.

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