<small>:备注元素
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2015年7月.
<small> HTML 元素代表旁注和小字印刷(如版权和法律文本),与其样式的呈现方式无关。默认情况下,它以比其中的文本小一号的字体大小呈现,例如从 small 变为 x-small。
尝试一下
<p> MDN Web Docs is a learning platform for Web technologies and the software that powers the Web. </p> <hr /> <p> <small >The content is licensed under a Creative Commons Attribution-ShareAlike 2.5 Generic License.</small > </p> small { font-size: 0.7em; } 属性
这个元素只包含全局属性。
示例
>基本用法
html
<p> 这是第一句。 <small>整个句子采用了较小的字体显示。</small> </p> 结果
CSS 替代
html
<p> 这是第一句。 <span style="font-size:0.8em">整个句子采用了较小的字体显示。</span> </p> 结果
备注
尽管 <small> 元素像 <b> 和 <i> 元素一样,可能被认为违反了结构与表现分离的原则,但这三个元素在 HTML 中都是有效的。建议作者根据实际情况使用 <small> 或者 CSS 来做判断。
技术概要
规范
| Specification |
|---|
| HTML> # the-small-element> |