Blogger Information
Blog 34
fans 2
comment 2
visits 22741
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
基本选择器
AsNwds_MIS王的博客
Original
590 people have browsed it

基本选择器

实例

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>基本选择器</title>

	<style type="text/css">
		.demo {
				width: 100px;
				border: 1px;
				padding: 10px;			
			}
			ul{
				list-style: none;
			}

 			li {
 				
				float: left;
				height: 20px;
				line-height: 20px;
				width: 20px;
				border-radius: 50px;
				text-align: center;
				background: yellow;
				color: green;
				margin-right: 15px;


			}
			#red {color: red}		
			.items{
					margin-right: 4px;
					background-color: pink;

				  }
			li.back{
						background-color: blue;
					}
			.active{font-size: 10px;}
			.first.last{background: black;}
			ul>li {
					background-color: orange;
				}
			#last + li{
						background-color: purple;
					}



	</style>	
</head>
<body>
 			
 		<div class="demo">
				<ul >
					<li id="red" class="first">1</li>
					<li class="active back">2</li>
					<li class="back items">3</li>
					<li class="back">4</li>
					<li class="items active">5</li>
					<li id="green" class="second"><h2>6</h2></li>
					<li style="color:grey">7</li>
					<li><a href=""><em>8</em></a></li>
					<li id="last"><strong>9</strong></li>
					<li >10</li>
				</ul>
			</div>



</body>
</html>

运行实例 »

点击 "运行实例" 按钮查看在线实例

属性选择器

实例

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>属性选择器</title>

	<style type="text/css">
		.demo {
				width: 100px;
				border: 1px;
				padding: 10px;			
			}
			ul{
				list-style: none;
			}

 			li {
 				
				float: left;
				height: 20px;
				line-height: 20px;
				width: 20px;
				border-radius: 50px;
				text-align: center;
				background: yellow;
				color: green;
				margin-right: 15px;


			}
			#red {color: red}		
			.items{
					margin-right: 4px;
					background-color: pink;

				  }
			li.back{
						background-color: blue;
					}
			.active{
					font-size: 10px;
				   }
			*[id] {
					background-color: black;
				  }
			ul>li {
					background-color: orange;
				  }
			#last + li{
						background-color: purple;
				   	  }
			li[class ~="item"] {
								background-color: black;
							   }
			li[class ="item"] {
								background-color: beige;
							   }



	</style>	
</head>
<body>
 			
 		<div class="demo">
				<ul >
					<li id="red" class="first">1</li>
					<li class="active back">2</li>
					<li class="back items">3</li>
					<li class="back">4</li>
					<li class="items active">5</li>
					<li id="green" class="second"><h2>6</h2></li>
					<li style="color:grey">7</li>
					<li><a href=""><em>8</em></a></li>
					<li id="last"><strong>9</strong></li>
					<li >10</li>
				</ul>
			</div>



</body>
</html>

运行实例 »

点击 "运行实例" 按钮查看在线实例

微信图片_20180322143455.jpg

Correction status:qualified

Teacher's comments:这两天的作业已检查!! 完成的依旧的很不错!!继续保持!!
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post