1. 程式人生 > >017子代選擇器後代選擇器

017子代選擇器後代選擇器

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>選擇器</title>
	<style>
		#box div{
			color: blue;
		}
		#main>div{
			width: 50px;
			height: 50px;
			background: red;
			margin:10px;
			color: yellow;
		}
	</style>
</head>
<body>
	
	<div id="main">
		<div id="box">
			<div>c_1</div>
			<div>c_2</div>
			<div>c_3</div>
		</div>
		<div>2</div>
		<div>3</div>
	</div>
</body>
</html>