HTML5中weight属性的作用,css font-weight属性怎么用
css font-weight屬性用于設置顯示元素的文本中所用的字體加粗。數字值 400 相當于 關鍵字 normal,700 等價于 bold。所有主流瀏覽器都支持 font-weight 屬性。
css font-weight屬性怎么用?
font-weight屬性設置文本的粗細。
語法:font-weight:normal|bold|bolder|lighter|數值|inherit;
屬性值:
● normal:默認值。定義標準的字符。
● bold:定義粗體字符。
● bolder:定義更粗的字符。
● lighter:定義更細的字符。
● 數值:定義由粗到細的字符,可以設置的數值有:100、200、300、400、500、600、700、800、900。其中400 等同于 normal,而 700 等同于 bold。
● inherit:規定應該從父元素繼承字體的粗細。
說明:該屬性用于設置顯示元素的文本中所用的字體加粗。數字值 400 相當于 關鍵字 normal,700 等價于 bold。每個數字值對應的字體加粗必須至少與下一個最小數字一樣細,而且至少與下一個最大數字一樣粗。
注釋:所有主流瀏覽器都支持 font-weight 屬性。
css font-weight屬性 示例
p.normal {font-weight:normal;}
p.light {font-weight:lighter;}
p.thick {font-weight:bold;}
p.thicker {font-weight:900;}
This is a paragraph.
This is a paragraph.
This is a paragraph.
This is a paragraph.
效果圖:
總結
以上是生活随笔為你收集整理的HTML5中weight属性的作用,css font-weight属性怎么用的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 云专网和云专线的区别_什么是云网融合?
- 下一篇: Echars地图加散点图配置