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


CSS font-kerning用法及代碼示例

此屬性用於控製已存儲在字體中的字距信息的使用。字距定義字母的間距。對於沒有字距調整信息的字體,此屬性將沒有可見效果。

用法:

font-kerning:auto|normal|none;

屬性:


  • auto:它是默認值。瀏覽器決定是否應用font-kerning。
  • normal:用於指定font-kerning通常在瀏覽器上應用。
  • none:用於指定不應用font-kerning。

例:

<!DOCTYPE html> 
<html> 
    <head> 
        <title> 
            CSS | font-kerning Property 
        </ttile> 
        <style>  
            div { 
                font-family:serif; 
                font-size:20px; 
                font-weight:bold; 
            } 
            div.geeks { 
                font-kerning:normal; 
            } 
            div.SUDO { 
                font-kerning:auto; 
            } 
            div.gfg { 
                font-Kerning:none; 
            } 
            h1 { 
                color:green; 
            } 
            body { 
                text-align:center; 
            } 
        </style> 
    </head> 
    <body> 
        <h1>GeeksforGeeks</h1> 
        <h2>The font-kerning Property</h2> 
        <h3>font-kerning:normal;</h3> 
        <div class="geeks"> 
         GeeksforGeeks:  
         A computer science portal for Geeks 
        </div> 
        <h3>font-kerning:auto;</h3> 
        <div class="sudo"> 
         GeeksforGeeks:  
         A computer science portal for Geeks</div> 
        <h3>font-Kerning:none;</h3> 
        <div class="gfg"> 
         GeeksforGeeks:  
         A computer science portal for Geeks 
        </div> 
    </body> 
</html>                    

輸出:

支持的瀏覽器:CSS | Java支持的瀏覽器。下麵列出了font-kerning屬性:

  • Google Chrome 32.0 -webkit-
  • Internet Explorer 10.0
  • Firefox 34.0
  • Opera
  • Safari 7.0


相關用法


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