
文章插圖
1、行內(nèi)樣式(內(nèi)聯(lián)樣式)
例:<body >
2、內(nèi)部樣式
例:<head>
<style type="text/css">
【個(gè)人html】body {
background-color:#cccccc;}</style></head>
3、外部樣式
例:style.css
body { background-color:#cccccc;
}index.html
<head>
<link rel="stylesheet" type="text/css" />
</head> css選擇器
1、標(biāo)簽選擇符(又稱為元素選擇符、類型選擇符)
2、id 及 class 選擇符
3、屬性選擇符 [title] a{color:red;} (為所有的屬性是title的a標(biāo)簽的元素變成紅色)
4、包含選擇符
5、偽類選擇符
a:link {color: #FF0000; text-decoration: none} /* 未訪問的鏈接 */
a:visited {color: #00FF00; text-decoration: none} /* 已訪問的鏈接 */
a:hover {color: #FF00FF; text-decoration: underline} /* 鼠標(biāo)在鏈接上 */
a:active {color: #0000FF; text-decoration: underline} /* 激活鏈接 */
6、優(yōu)先級(jí)依次是:
行內(nèi)樣式表 > 內(nèi)部樣式表 > 外部樣式表
7、選擇符id的定義優(yōu)先于class 的定義
8、通配符 *
9、瀏覽器優(yōu)先執(zhí)先 !important標(biāo)注的語句 。
相關(guān)經(jīng)驗(yàn)推薦
- 神佑釋放神佑怎么選 神佑釋放神佑推薦
- 神佑釋放守護(hù)輸出怎么循環(huán) 神佑釋放守護(hù)輸出循環(huán)技巧
- 神佑釋放怎么切換頻道 神佑釋放頻道切換方法介紹
- 神佑釋放道具怎么合成 神佑釋放道具合成方法介紹
- 神佑釋放篝火有什么用 神佑釋放篝火功能介紹
- 神佑釋放加點(diǎn)怎么加 神佑釋放加點(diǎn)心得
- 多想留在你身邊歌詞 多想留在你身邊歌簡(jiǎn)介
- 苦茶歌詞 苦茶歌曲介紹
- 歌詞多想留在你的身邊 多想留在你的身邊歌曲介紹
- 別讓我一個(gè)人醉原唱歌詞 別讓我一個(gè)人醉歌曲介紹
