i、em、b、strong元素的使用详解


当前第2页 返回上一页

1

2

3

4

5

6

7

8

9

10

11

12

13

14

// 下面的 b 元素起到突出关键词的作用,但不具备强调重要性的作用

<p>The <b>frobonitor</b> and <b>barbinator</b> components are fried.</p>

// 下面的 b 元素让被包围的词特殊化

<p>You enter a small room. Your <b>sword</b> glows

brighter. A <b>rat</b> scurries past the corner wall.</p>

// 下面的 b 元素标注了文章的导语

<article>

  <h2>Kittens 'adopted' by pet rabbit</h2>

  <p><b class="lede">Six abandoned kittens have found an

    unexpected new mother figure ― a pet rabbit.</b></p>

  <p>Veterinary nurse Melanie Humble took the three-week-old

    kittens to her Aberdeen home.</p>

  ...

</article>

规范建议:

The b element should be used as a last resort when no other element is more appropriate. In particular, headings should use the h1 to h6 elements, stress emphasis should use the em element, importance should be denoted with the strong element, and text marked or highlighted should use the mark element.

就是说当没有其他元素合适时,最后才考虑用b标签。特别是,标题应该使用h1到h6标签,突出对内容的强调用em标签,突出重要紧急用strong标签,文本标记使用mark标签。

strong介绍

规范描述:

The strong element represents strong importance, seriousness, or urgency for its contents.

译文:

strong 元素代表内容的强烈的重要性、严重性或者紧急性。

重要性

<strong> 元素可以被用在标题(heading)、说明(caption)或者段落(paragraph)上,来显示这部分被包围的文字的重要性。

1

2

// 章节序号不重要,章节的名字才重要

<h1>Chapter 1: <strong>The Praxis</strong></h1>

严重性

<strong> 元素可以被用来标记警告或者警示标志。

1

<p><strong>Warning.</strong> This dungeon is dangerous.</p>

紧急性

<strong> 元素可以被用来表示需要被尽快看见的部分。

1

2

3

4

5

6

7

<p>Welcome to Remy, the reminder system.</p>

<p>Your tasks for today:</p>

<ul>

  <li><p><strong>Turn off the oven.</strong></p></li>

  <li><p>Put out the trash.</p></li>

  <li><p>Do the laundry.</p></li>

</ul>

小结:

根据规范来看,em和strong的语义情景很明显,b和i的理解还是有些晦涩,个人的理解是:

1、em会对文本含义有改变作用,类似读一句话时重读某一个字或词会表达不一样的意思一样。

2、strong会突出包含文本的重要性、严重性和紧急性等。

3、i标签为了表示不同语态或特性的文本,有点像文字排版里面的那些用斜体表示的内容(技术术语、外语习语这些排版会有不同的内容)。

4、b标签主要是为了突出显示关键词、产品名称等;

b标签的语义规范也是很模糊,所以也是不太建议用。

相信看了本文案例你已经掌握了方法,更多精彩请关注php中文网其它相关文章!

推荐阅读:

H5的存储方式详解

zepto实现移动端无缝向上下滚动

以上就是i、em、b、strong元素的使用详解的详细内容,更多文章请关注木庄网络博客

返回前面的内容

相关阅读 >>

数组filter对数组元素进行过滤的方法

canvas的绘图api使用详解

jquery怎么判断元素是否有某个属性

dom节点 vs 元素,两者有什么区别?

html中strong用法是什么

phonegap创建联系人详解

如何竖直居中一个元素

h5的游戏开发详解

jquery怎么判断元素是否被点击

phonegap播放音频详解

更多相关阅读请进入《strong》频道 >>




打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...