练习浮动和定位

Original 2019-01-21 19:17:51 148
abstract:<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <style> .box1{ width: 200px; height: 100p
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style>
			.box1{
				width: 200px;
				height: 100px;
				border: 1px solid #ccc;
				position: relative;
				float: left;
			}
			.box2{
				width: 100px;
				height: 50px;
				border: 1px solid red;
				position: absolute;
				left: 0;
				bottom: 0;
			}
			/*子绝父相*/
			.box3{
				clear: both;/*清除浮动*/
			}
			.box4{
				width: 300px;
				height: 200px;
				border: 1px solid red;
				
			}
		</style>
	</head>
	<body>
		<div class="box1">父元素
		<div class="box2">子元素</div>
		</div>
		<div class="box3"></div>
		<div class="box4"></div>
	</body>
</html>


Correcting teacher:韦小宝Correction time:2019-01-22 09:25:49
Teacher's summary:写的很不错 css中的浮动很重要 当然浮动也会带来很大的麻烦 要记得清除浮动

Release Notes

Popular Entries