CSS的簡單復習總結
如果說網頁是人的話那麽CSS就是化妝品了哈哈哈,所以網頁離不開CSS的裝飾。
id選擇器和Class選擇器 二者都是用來選擇元素進行裝飾的,我個人理解是類選擇器包含了id選擇器,class選擇器不進能選出單個元素還能還能選出一類元素。
外部樣式表 在外部進行編寫代碼在網站的代碼進行調用
內部樣式表 在網頁的<head>中用加<style>然後用類選擇器來調用
內聯樣式表 在標簽中加style就能直接修飾
背景(background) background-color 背景顏色
background-image 背景圖片
background-repeat 背景圖片平鋪 如:background-repeat:no-repeat 、background-repeat:repeat-x
background-attachment 背景圖片固定 如:background-attachment:pixed
文本(text) color 文本顏色
text-align 文本對齊方式 如:text-align:center 、 text-align:right 、 text-align:justify
text-decoration 文本修飾 如:text-decoration:none(刪除下劃線)
text-transform 文本轉換 如:text-transform:overline 、 text-transform:line-through 、 text-transform:upperline
text-indent 文本縮進 如:text-indent:20px
還有一些拓展的 letter-spaing 字符之間的距離
line-height 行與行之間的高度
direction 文本書寫方向 如:direction:rtl 從右往左寫
word-spacing 增加單詞之間的空白空間
white-space:nowrap 禁用文本環繞(就是把多行文本寫成一行)
text-shadow 增加陰影效果 如:text-shadow:2px 2px #FF0000
字體(fonts) font-family 字體屬性
font-style 字體樣式
font-size 字體大小
font-weight 字體的粗細 字體變細font-weight:lighter 變粗font-weight:500
鏈接(link)
a:link {color:#000000;} /* 未訪問鏈接*/ a:visited {color:#00FF00;} /* 已訪問鏈接 */ a:hover {color:#FF00FF;} /* 鼠標移動到鏈接上 */ a:active {color:#0000FF;} /* 鼠標點擊時 */
color
text-decoration
background-color
CSS的簡單復習總結