标签:box font div 标签 color 过程 head bsp 选择器
样式优先级:默认样式<标签选择器<类选择器<id选择器<行内样式<!important
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<style>
#main {
font-size: 80px;
color: blue;
}
.box {
font-size: 40px !important;
color: yellow;
}
div{
font-size:20px;
color:red;
}
</style>
</head>
<body>
<div class="box" id="main" style="font-size:120px;color:gray">哈哈</div>
</body>
</html>
注释:上述代码为了屏蔽样式的层叠性,样式表都是反浏览器渲染的过程书写的,最后还是以标注了!important的标签选择器为为主。
标签:box font div 标签 color 过程 head bsp 选择器
原文地址:http://www.cnblogs.com/wuqiuxue/p/7771556.html