個人html 的學習躰會,帶你了解html的學習內容
個人html 的學習躰會,帶你了解html的學習內容
原|2019-07-30 15:19:52|瀏覽:89
1、行內樣式(內聯樣式)
例:<body >
2、內部樣式
例:<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、優先級依次是:
行內樣式表 > 內部樣式表 >外部樣式表
7、選擇符id的定義優先於class 的定義
8、通配符 *
9、瀏覽器優先執先 !important標注的語句。
0條評論