1. 程式人生 > >CSS進階(十五)font-weight;font-style;font-variant

CSS進階(十五)font-weight;font-style;font-variant

/* 平常用的最多的 */
font-weight: normal;
font-weight: bold;
/* 相對於父級元素 */
font-weight: lighter;
font-weight: bolder;
/* 字重的精細控制 */
font-weight: 100;
font-weight: 200;
font-weight: 300;
font-weight: 400;
font-weight: 500;
font-weight: 600;
font-weight: 700;
font-weight: 800;
font-weight: 900; 

font-weight:400 == font-weight:normal

font-weight:700 == font-weight:bold

lighter和border的解析規則

平時使用的300,400,500時沒有顯著變化的原因,是缺乏對應字重的字型

font-style

font-style: normal;
font-style: italic;//使用當前字型的斜體字型
font-style: oblique; //單純地讓文字傾斜

在實際開發的 時候,幾乎沒有任何理由需要使用 font-style:oblique

font-variant

實現小體型大寫字母,兩個屬性值要麼 normal, 要麼 small-caps