當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


HTML small用法及代碼示例

HTML中的<small>標記用於設置較小的字體。

用法:

<small> Contents... </small>

範例1:

<!DOCTYPE html>  
<html> 
    <head> 
        <title>small Tag</title> 
        <style> 
            body { 
                text-align:center; 
            } 
            h1 { 
                color:green; 
            } 
        </style> 
    </head> 
    <body> 
        <h1>GeeksforGeeks</h1> 
        <h2><small> Tag</h2> 
        <small>Welcome to GeeksforGeeks!</small> 
    </body> 
</html>                    

輸出:

範例2:使用CSS屬性設置較小的字體。



<!DOCTYPE html>  
<html> 
    <head> 
        <title>small Tag</title> 
        <style> 
            body { 
                text-align:center; 
            } 
            h1 { 
                color:green; 
            } 
            .gfg { 
                font-size:smaller; 
            } 
        </style> 
    </head> 
    <body> 
        <h1>GeeksforGeeks</h1> 
        <h2>font-size:smaller;</h2> 
        <div class = "gfg">Welcome to GeeksforGeeks!</div> 
    </body> 
</html>                    

輸出:

支持的瀏覽器:<small>標簽支持的瀏覽器如下:

  • 穀歌瀏覽器
  • IE瀏覽器
  • Firefox
  • Safari
  • Opera




相關用法


注:本文由純淨天空篩選整理自vt_m大神的英文原創作品 HTML | small Tag。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。