64㎡年輕小夫妻的家,三居改一居,安放屋主的所有喜好!
2023-01-30
更新時間:2022-03-13 19:30:59作者:佚名
1、行內(nèi)樣式(內(nèi)聯(lián)樣式)
例:<body >
2、內(nèi)部樣式
例:<head>
<style type="text/css">
body {
background-color:#cccccc;}</style></head>
3、外部樣式
例:style.css
body { background-color:#cccccc;
}index.html
<head>
<link rel="stylesheet" type="text/css" href="style.css" />
</head> css選擇器
1、標簽選擇符(又稱為元素選擇符、類型選擇符)
2、id 及 class 選擇符
3、屬性選擇符 [title] a{color:red;} (為所有的屬性是title的a標簽的元素變成紅色)
4、包含選擇符
5、偽類選擇符
a:link {color: #FF0000; text-decoration: none} /* 未訪問的鏈接 */
a:visited {color: #00FF00; text-decoration: none} /* 已訪問的鏈接 */
a:hover {color: #FF00FF; text-decoration: underline} /* 鼠標在鏈接上 */
a:active {color: #0000FF; text-decoration: underline} /* 激活鏈接 */
6、優(yōu)先級依次是:
行內(nèi)樣式表 > 內(nèi)部樣式表 > 外部樣式表
7、選擇符id的定義優(yōu)先于class 的定義
8、通配符 *
9、瀏覽器優(yōu)先執(zhí)先 !important標注的語句。