<small>: side-comment 元素
<small> HTML 元素表示 side-comment 和小字,例如版权和法律文本,与其样式表示无关。默认情况下,它会将其内的文本渲染得比正常字体小一个字号,例如从 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>
This is the first sentence.
<small>This whole sentence is in small letters.</small>
</p>
结果
CSS 替代方案
html
<p>
This is the first sentence.
<span class="small">This whole sentence is in small letters.</span>
</p>
css
.small {
font-size: 0.8em;
}
结果
注意
虽然 <small> 元素,就像 <b> 和 <i> 元素一样,可能被认为违反了结构与表示分离的原则,但这三个在 HTML 中都是有效的。鼓励作者在使用 <small> 或 CSS 时自行判断。
技术摘要
规范
| 规范 |
|---|
| HTML # the-small-element |
浏览器兼容性
加载中…