第4课盒子的浮动与定位

53 阅读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;
		}
		.father p {
			border:1px dashed #111111;
			background: #ff90ba;
		}
		div:nth-child(1){
			float:left;
		}
		div:nth-child(2){
			float:left;
		}
		div:nth-child(3){
			float:right;
		}
		div p {
			clear: both;
			padding-top: 10px;
		}
	</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>
	<p>dddddddddddddddd ddddddddddddddddd
		ddddddddsdd的点点滴滴的点点
		滴滴啊打的等等的点点滴滴的点点滴滴的点点滴滴多大撒代发手打水电费费水岸东方士大夫大厦dddddddddddddddd ddddddddddddddddd
		ddddddddsdd的点点滴滴的点点
		滴滴啊打的等等的点点滴滴的点点滴滴的点点滴滴多大撒代发手打水电费费水岸东方士大夫大厦
	</p>
</div>

</body>
</html>

截屏2022-11-24 13.48.38.png