上篇文章主要講述了CSS樣式更改中的背景Background,這篇文章咱們來談談字體設置Font&邊框Border的基礎用法。網絡
<div style='font-family: sans-serif normal'></div> 可用字體: Serif Sans-serif Monospace Cursive Fantasy Times Courier
<div style='font-style:normal'></div> 文本傾斜: normal 文本正常顯示 italic 文本斜體顯示 oblique 文本傾斜顯示
<div style='font-variant:small-caps'></div> normal 顯示標準字體。 small-caps 顯示小型大寫字母的字體。
<div style='font-weight:normal'></div> normal 標準的字符 bold 粗體字符 bolder 更粗的字符 lighter 更細的字符 也能夠使用數字表示,範圍爲100~900
<div style='font-size:60px'></div> smaller 變小 larger 變大 length 固定值 並且還支持百分比
首先說一下邊框風格,它的風格比較多,經常使用的通常是實線爲主:學習
<div style='border-style:none'></div> hidden 隱藏邊框 dotted 點狀邊框 dashed 虛線邊框 solid 實線邊框 double 雙線邊框 groove 3D凹槽邊框 ridge 3D壟狀邊框 inset 3D inset邊框 outset 3D outset邊框 邊框也有四面,因此也會有上下左右 因此有時候爲了更精肯定位並修改樣式能夠使用: border-top-style 上邊框樣式 border-right-style 右邊框樣式 border-bottom-style 下邊框樣式 border-left-style 左邊框樣式
先定義邊框的寬度 風格和顏色,而後定義邊框的其它屬性。字體
<div style='border-radius:25px;'></div>
2).邊框陰影網站
<div style='box-shadow:1px 2px 2px 2px red'></div> 參數含義: 邊框各個方向的大小和顏色
3).邊框圖片url
<div style='border-image:url(1.png) 30 30 10 round'></div> 參數含義: 邊框圖片的路徑 圖片邊框向內偏移 圖片邊框的寬度 邊框圖像區域超出邊框的量 圖像邊框是否應平鋪(repeated)、鋪滿(rounded)或拉伸(stretched)。
這篇文章主要介紹了CSS樣式更改篇中的字體設置Font&邊框Border設置,但願讓你們對CSS選擇器有個簡單的認識和了解。
看完本文有收穫?請轉發分享給更多的人spa
IT共享之家code
想要學習更多,請前往Python爬蟲與數據挖掘專用網站:http://pdcfighting.com/
想學習更多Python網絡爬蟲與數據挖掘知識,可前往專業網站:http://pdcfighting.com/orm