WEB-CSS权重


<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style>
	#ya {  /*权重 0,1,0,0*/
		color: blue;
	}
	
	.yase {   /* 类选择器权重 高于 标签选择器   权重   0, 0, 1, 0*/
		color: green;
	}

	div { 
		/* 权重   0, 0, 0, 1*/
		/* 权重   0, 0, 0, 1*/
		color: red;
	}

	
	div { 
		/* 权重   0, 0, 0, 1*/
		/* 权重   0, 0, 0, 1*/
		color: hotpink!important;
	}


	*  {    0 0 0 0 

	}

	/**  0000
	div 0001
	.one 0010
	#two 0100
	行内 1000
	important ∞*/
	</style>
</head>
<body>
	<div class="yase" id="ya" style="color: orange">亚瑟</div>
</body>
</html>

猜你喜欢

转载自blog.csdn.net/qq_31741481/article/details/85687507