<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 |
瀏覽器相容性
載入中…