HTML&CSS Day5 CSS權重 與屬性
<html>
<head>
<title></title>
<style type="text/css">
/* 權重大小規則
標籤權重:1 class權重:10 id權重:100
權重表達方式:0000
類型選擇符:0001
class選擇符:0010
id選擇符:0100
偽類選擇符:0010
包含選擇符:權重之和
內聯樣式:1000
集成樣式:0000
*/
div{
width: 100px;
height: 100px;
background:red;
}
#head{
background: purple;
}
.view{
background: blue;
}
</style>
</head>
<body>
<div class="view" id="head"></div>
</body>
</html>
********************屬性
<head>
<title>
</title>
<style type="text/css">
.content{
width:300px;
height: 200px;
/* 背景 */
/* 顏色16進制 */
/* background: #268fa1; */
/* rgb 三原色 */
/* background: rgb(210,250,25); */
background: rgba(125,165,91,1);
/* */
/* 字體顏色 */
color:rgb(57, 30, 210);
/*字體大小 (默認16px)*/
fornt-size:30px;
/* 6 字體類型 */
font-family:"宋體";
/* 加粗 */
font-weight: 800;
/* 斜體 */
font-style: italic;
/* 大小寫
small-caps
all-small-caps*/
font-variant: small-caps;
/* 水平對齊 */
text-align: left;
}
</style>
</head>
<body>
<p class="content">aaa笨蛋才努力</p>
</body>
留言
張貼留言