css中font的縮寫

來源:互聯網
上載者:User
本篇文章將詳細介紹css中font的縮寫,有感興趣的小夥伴參考一下。

執行個體代碼如下:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <style>     .login_top{height:26px;font:bold 14px/26px "宋體"; border:1px solid #000}     .login_top2{height:26px; line-height:26px; font-weight:bold;font-size:14px;border:1px  solid #000;  font-family:'宋體'} </style> <div class="login_top">我垂直不置中</div> <br/ > <div class="login_top2">我垂直置中</div>

總結:

1、簡寫時,font-size和line-height只能通過斜杠/組成一個值,不能分開寫。

2、順序不能改變.這種簡寫方法只有在同時指定font-size和font-family屬性時才起作用。而且,如果你沒有設定font-weight, font-style, 以及 font-varient ,他們會使用預設值

相關推薦:

js如何匹配計算font-size

font-size-adjust屬性如何最佳化網頁排版

font-weight:blod跳動如何處理

css3字型變體font-variation詳解

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.