css 字體、文本、列表樣式
1.字體樣式
font-family:設置字體類型 font-family:"隸書"||"wps裏面有的"||"常用微軟雅黑Microsoft YaHei";
font-size :設置字體大小 font-size:12px;
font-style :設置字體風格 font-style:
- normal - 文本正常顯示
- italic - 文本斜體顯示
- oblique - 文本傾斜顯示
font-weight:設置字體粗細 font-weight:
關鍵字 100 ~ 900 為字體指定了 9 級加粗度。如果一個字體內置了這些加粗級別,那麽這些數字就直接 映射到預定義的級別,100 對應最細的字體變形,900 對應最粗的字體變形。數字 400 等價於 normal, 而 700 等價於 bold。
符合屬性(必須按照順序寫)
舉例: font:italic bold 36px "宋體";
2.文本樣式
color:設置文本顏色 color:#00c(表示#0000cc)||red||#0acacc;
text-align: 設置元素水平對齊方式 text-align:left;
值 left、right 和 center 會導致元素中的文本分別左對齊、右對齊和居中。
text-indent:設置首行文本的縮進 text-indent:20px(縮進20個像素)||2em(縮進2個字符);
line-height:設置文本的行高 line-height:25px;
text-decoration:設置文本的裝飾
text-decoration 有 5 個值:
- none 什麽都沒有
- underline 下劃線
- overline 上劃線
- line-through 刪除線
- blink 閃爍
3.列表樣式
none:無標記符號 list-style-type:none;
disc:實心圓,默認類型 list-style-type:disc;
circle:空心圓
square:實心正方形
decimal:數字
css 字體、文本、列表樣式