如何在 HTML 中使用小字体?


HTML 中的 <small> 标记使 HTML 文档中的字体大小变小(比原始字体小一个大小)。

HTML <small> 标记位于 <body> 标记内。<small> 标记使文本的大小变小一个单位。

语法

以下是 <small> 标记的语法。

<small>The text…</small>

示例

以下是 <small> 标记的示例程序。

<!DOCTYPE html> <html> <body> <h1>Tutorials <small>point</small></h1> </body> </html>

示例

我们可以在 HTML 元素中使用 <small> 标记。以下是在 <p> 标记内使用 <small> 标记的示例程序。

<!DOCTYPE html> <html> <head> </head> <body> <p>DLF stands for <small>Delhi Land and Finance.</small> <br> Delhi Land and Finance is one of the largest commercial real estate developer in India.</p> </body> </html>

示例

以下是示例程序,使用 CSS 属性定义 HTML 中的较小文本。我们还可以使用 CSS 属性定义较小的文本。

<!DOCTYPE html> <html> <head> <style> span.small{ font-size: smaller; } </style> </head> <body> <p> <span class="small">DLF stands for Delhi Land and Finance.</span></p> <p> Delhi Land and Finance is one of the largest commercial real estate developer in India.</p> </body> </html>

更新于: 2022-11-11

264 次浏览

开启你的 职业生涯

通过完成课程获得认证

开始吧
广告
© . All rights reserved.