第4课盒子的浮动与定位

99 阅读1分钟
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
	<style>
		.father {
			background-color: #ffff99;
			border: 1px solid #111111;
			
		}
		.father div {
			padding:10px;
			margin: 15px;
			border: 1px dashed #111111;
		}
		
		div:nth-child(1){
			float:left;
		}
		div:nth-child(2){
			float:left;
		}
		div:nth-child(3){
			float:right;
		}
		.father .clear {
			clear: both;
			padding: 0;
			margin: 0;
			-webkit-order: 0;
			-moz-order: 0;
			-ms-order: 0;
			-o-order: 0;
			order: 0;
			
		}
		
	</style>
    
</head>
<body>
<div class="father">
	<div class="box1">box1</div>
	<div class="box2">box2</div>
	<div class="box3">
			box3<br/>
			box3<br/>
			box3<br/>
			box3<br/>
	</div>
	<div class="clear"></div>
	<div>ddddddddddd</div>
</div>
	


</body>
</html>