zl程序教程

您现在的位置是:首页 >  前端

当前栏目

语义化HTML:i、b、em和strong标签

HTML 标签 语义 EM strong
2023-09-14 08:58:00 时间

一、前言

  在HTML4.1中i和b作为表象标签分别表示斜体和粗体样式,而强调样式与内容分离的XHTML中则出现样式效果相同的em和strong表义标签,此时我们会建议避免使用i和b标签,应该改用em和strong标签。

  但在HTML5对i和b赋予新的语义,本文将再一次认识它们!

 

二、元素语义

  1. i标签

  W3C草案:

The i element represents a span of text in an alternate voice or mood, or otherwise offset from the normal prose (content whose typical typographic presentation is italicized).W3C specification

  语义化的  i 元素 可以用来表示:外文单词、生物分类、科技术语、船名、剧本舞台方位、乐谱、三个代表思想或手写文字。建议通过class特性标识具体语义,若为表示外文单词则采用lang特性标识具体的语言种类。示例:

  滑板介绍

  滑板的基本动作名为豚跳(ollie)





 h3 滑板介绍 /h3 

滑板的基本动作名为 i 豚跳 /i ( i lang="en_us" ollie /i )

 /p 

 2. b标签

   W3C草案:

The b element represents a span of text offset from its surrounding content without conveying any extra importance; for example, keywords in a document abstract, product names in a review, or other spans of text whose typical typographic presentation is bold text. W3C specification

  语义化的  b 元素 用于表示:局部范围内不重要但需要突出的内容,如概要中的关键字、评论中的名词等。建议通过class特性标识具体语义。示例:


滑板由 b 轮子 /b 、 b 板面 /b 、 b 磨砂纸 /b 和 b 支架 /b ( i lang="en_us "truck /i )组成。 /p

  3. em标签

    W3C草案:

The em element represents a span of text with emphatic stress.

W3C specification

   语义化的  em 元素 表示:局部范围内强调的内容,用于改变句子或段落的侧重点。注意其作用范围为局部,也就是阅读到某段落或句子时才会注意到。示例:

   ollie教学

   后脚踏板的同时前脚提起,并向斜前方跳起。

   后脚踏板的同时前脚提起,并向斜前方跳起。

   第一句强调 前脚提起,第二句强调 向斜前方跳起。

  4. strong标签

    W3C草案:

The strong element represents a span of text with strong importance.

W3C specification

    语义化的 strong 元素表示:全部范围内强调的内容,随意无序扫描全文时能突出的关键内容。

 

三、总结


17、SpringBoot2.0中初始化数据和不校验 html 标签(十七) 我们在做测试的时候经常需要初始化导入一些数据,如何来处理呢?会有两种选择,一种是使用 Jpa,另外一种是 Spring JDBC 。两种方式各有区别下面来详细介绍。
HTML标签中英文对照 标签 对应英文 说明 !-- 内容 -- 注释 !DOCTYPE document type a anchor [ æŋkə] 锚超链接 abbr abbreviation [əbriːvɪ’eɪʃ(ə)n] 缩写缩写词 acronym acronym [ ækrənɪm] 首字母缩略词缩写词 address address [ə’dres] 地址联系信息