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


HTML strong用法及代碼示例

HTML中的<strong>標記是已解析的標記,用於顯示文本的重要性。使該文本為粗體。

用法:

<strong> Contents... </strong>

例:

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

輸出:

範例2:使用CSS屬性設置粗體字體粗細。



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

輸出:

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

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




相關用法


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