问题描述
新手问题......
编码使用< span class = bold> ...< / span>是否更好?围绕文字
我想要应用内联粗体样式而不是< b> ...< / b> ?
如果是这样,为什么?
Newbie question...
Is it better coding to use <span class=bold>...</span> around text to
which I want to apply an inline bold style rather than <b>... </b> ?
If so, why?
推荐答案
看,你问的是非常好的问题。你想知道原因:-)
好吧,在你想要应用
内联粗体样式的文本周围放置任何东西之前,问问自己为什么你想要那样做?如果要强调这一点,有两种方法可以实现:
< p>如果你想要< em>这部分要强调< / em>,你只是给了它。
如果你想要< strong>更强调强调< / strong>,这就是使用它。< / p>
在许多图形浏览器中,重点变为斜体和强烈
强调变为粗体。
参见< URL:http:// www.w3.org/TR/html401/struct/text.html#edef-EM> for
其他内联元素,赋予一些文本含义。肯定会有一两个你可以用于你的目的。
如果它与你需要的不同,那么,那就是这是
样式表的来源(参见本集团的主题)。用一个简单的
em {
font-style:normal;
font-weight:bold; }
或
strong {
font-style:italic;
字体重量:正常;你可以反转这两个标准渲染:-)想想还有什么呢?你可以这样做。$ / b。
>
所以,简而言之:首先要知道为什么,你问的问题。为什么你要b b $ b想要一个特定的文本突出,不同。把它标记为
这样,让CSS为你照顾好看。
-
______PretLetters:
|博客| http://www.pretletters.net/weblog/weblog.html |
| webontwerp | http://www.pretletters.net/html/webontwerp.html |
| zweefvliegen | http://www.pretletters.net/html/vliegen.html |
See, you ask the very good questions. You want to know why :-)
Well, before puting anything around text to which you want to apply an
inline bold style, ask yourself why you want to do that? If it is to give
the bit emphasis, there are two ways to accomplish that:
<p>If you want <em>this part to have emphasis</em>, you just gave it that.
If you want <strong>stronger emphasis</stronger>, this is what to use.</p>
In many graphical browsers emphasis gets rendered italic and strong
emphasis gets rendered bold.
See also <URL:http://www.w3.org/TR/html401/struct/text.html#edef-EM> for
other inline elements that give meaning to a bit of text. There''s bound to
be one or two you could use for your purposes.
And if it renderes differently from what you need, well, that''s where the
stylesheets come in (see, back on topic for this group). With a simple
em {
font-style:normal;
font-weight:bold; }
or
strong {
font-style:italic;
font-weight:normal; }
you can reverse the standard rendering of those two :-) Think of what else
you can do that way.
So, in short: first know the why, the very question you ask. Why do you
want a specific piece of text to stand out, to be different. Mark it up as
such, and let CSS take care of the looks for you.
--
______PretLetters:
| weblog | http://www.pretletters.net/weblog/weblog.html |
| webontwerp | http://www.pretletters.net/html/webontwerp.html |
|zweefvliegen | http://www.pretletters.net/html/vliegen.html |
非常感谢。这是非常有用的信息。另外,我认为我应该使用< em>
和< strong> over< i>和< b>因为后面的标签不是
必然与语音阅读器兼容?是< b>和< i>标签
实际上已弃用了吗?
再次感谢,
Dan
Thanks so much. This is extremely informative. Also, I assume I should
use <em> and <strong> over <i> and <b> because the latter tags are not
necessarily compatible with speech readers? Are <b> and <i> tags
actually deprecated though?
Thanks again,
Dan
非常感谢。这是非常有用的信息。另外,我认为我应该使用< em>
和< strong> over< i>和< b>因为后面的标签不是
必然与语音阅读器兼容?是< b>和< i>标签
实际上已弃用了吗?
再次感谢,
Dan
Thanks so much. This is extremely informative. Also, I assume I should
use <em> and <strong> over <i> and <b> because the latter tags are not
necessarily compatible with speech readers? Are <b> and <i> tags
actually deprecated though?
Thanks again,
Dan
这篇关于跨类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!