CSS的基本种类:标签选择器,类选择器,Id选择器,伪类选择器,伪元素选择器.

代码演示:

<!DOCTYPE html>
<html>
<head>
	<title>网页设计复习</title>
	<style>
	 h2{
	 	/*color: red;*/
	 	/*color:#ff0000;*/
	 	/*color:#f00;*/
	 	color:rgb(255,255,255);
	 	background-color: grey;
	 	width: 200px;
	 	height: 60px;
	 	text-align: center;
	 	line-height: 60px;
	 	box-shadow: 2px 2px 4px purple;
	 	text-shadow: 2px 2px 4px purple;
	 }
	 h2:hover{
	 	color:red;
	 	background-color: blue;
	 	position: relative;
	 	left:2px;
	 	bottom: 2px;
	 }
	 .weight{
	 	font-weight: 900;
	 }
	 .big{
	 	font-size: x-large;
	 }
	 #author{
	 	border-bottom: 1px solid grey;
	 	width: 200px;
	 	text-align: center;
	 	text-shadow: 2px 2px 4px purple;
	 }
	 p:hover:before{
	 	content: ">>>"
	 }		
	</style>
</head>
<body>
	<h2>网页设计复习</h2>
	<h3 id="author">作者:马老师</h3>
	<p class="weight">第1段文字</p>
	<p class="big">第2段文字</p>
	<p class="weight big">第3段文字</p>
</body>
</html>