如何在 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>

更新於: 11-11-2022

264 次瀏覽

開啟你的 職業生涯

透過完成課程獲得認證

開始學習
廣告
© . All rights reserved.