概要
这个 HTML mark 标签代表突出显示的文字,例如可以为了标记特定上下文中的文本而使用这个标签. 举个例子,它可以用来显示搜索引擎搜索后关键词。
用法说明:
- 内容分类 Flow content, phrasing content, palpable content.
- 允许的内容 Phrasing content.
- 标签省略 不允许,开始标签和结束标签都不能省略。
- 允许的父元素任何接受phrasing content 的元素.
- DOM 接口
HTMLElement
属性
这个元素只包含了 全局属性.
例子
<p><mark> 元素用于 <mark>highlight</mark> 文本</p>
结果
<mark> 元素用于 highlight 文本
说明
| Specification | Status | Comment |
|---|---|---|
| WHATWG HTML Living Standard <mark> |
Living Standard | |
| HTML5 <mark> |
Recommendation |
浏览器兼容性
| Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
|---|---|---|---|---|---|
| Basic support | (Yes) | 4.0 (2.0) | 9.0 | 11.0 | (Yes) |
| Feature | Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|
| Basic support | ? | 4.0 (2.0) | ? | ? | ? |
参见
- Other text-level semantics elements:
<a>,<em>,<strong>,<cite>,<q>,<dfn>,<abbr>,<time>,<code>,<var>,<samp>,<kbd>,<sub>,<sup>,<i>,<b>,<mark>,<ruby>,<rp>,<rt>,<bdo>,<span>,<br>,<wbr>.