实现浮动的机制有哪几种
实现浮动的机制有哪几种
实现浮动的机制有哪几种
2016-07-22
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>demo</title>
<style type="text/css" media="screen">
.wrap{
position:relative;
width:700px;
margin:0 auto;
}
div{
width: 100px;
height: 100px;
}
.left{
background-color: red;
float:left;
}
.right{
background-color:blue;
float:left
}
.left1{
background-color:green;
position:absolute;
left:0;
top:110px;
}
.right1{
background-color:pink;
position:absolute;
left:110px;
top:110px;
}
</style>
</head>
<body>
<div class="wrap">
<div class="left"></div>
<div class="right"></div>
<div class="left1"></div>
<div class="right1"></div>
</div>
</body>
</html>
举报