码迷,mamicode.com
首页 > 其他好文 > 详细

Relative与Absolute组合使用

时间:2018-09-25 21:57:03      阅读:227      评论:0      收藏:0      [点我收藏+]

标签:highlight   har   head   type   color   css   text   组合   sharp   

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
	<title>框架</title>
	<style type="text/css">
	div{border: solid black 1px;}
	h1{
		color: red;
	}
	div{
		background-color: #0fc;
	}
	.box1{
		width: 800px;
		height: 100px;
		position: relative;
	}
	.box2{
		width: 200px;
		height: 300px;
		top: 100px;
		position: absolute;
	}
	.box3{
		width: 400px;
		height: 100px;
		left: 200px;
		top: 100px;
		position: absolute;	
	}
	.box4{
		width: 400px;
		height: 100px;
		left: 200px;
		top: 200px;
		position: absolute;
	}
	.box5{
		width: 400px;
		height: 100px;
		left: 200px;
		top: 300px;
		position: absolute;
	}
	.box6{
		width: 200px;
		height: 300px;
		left: 600px;
		top: 100px;
		position: absolute;
	}
	</style>
</head>
<body>
    <h1>Relative与Absolute组合使用</h1>
    <br>
    <div class="box1">
       <div class="box2"></div>
       <div class="box3"></div>
       <div class="box4"></div>
       <div class="box5"></div>
       <div class="box6"></div>
    </div>
</body>
</html>

  

Relative与Absolute组合使用

标签:highlight   har   head   type   color   css   text   组合   sharp   

原文地址:https://www.cnblogs.com/ljming/p/9703579.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!