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

左右定宽中间自适应布局

时间:2017-05-06 22:59:59      阅读:154      评论:0      收藏:0      [点我收藏+]

标签:oat   doctype   左右   中间   type   tle   meta   round   div   

<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
* {
margin: 0;
padding: 0;
}

.left {
float: left;
width: 200px;
height: 200px;
background-color: red;
margin-right: -200px;
}

.middle {
float: left;
width: 100%;
}

.middle-content {
height: 200px;
margin-left: 200px;
margin-right: 200px;
background-color: yellow;
}

.right {
float: right;
width: 200px;
height: 200px;
background-color: blue;
margin-left: -200px;
}
</style>
</head>

<body>
<div class="left"></div>
<div class="middle">
<div class="middle-content"></div>
</div>
<div class="right"></div>
</body>

</html>

左右定宽中间自适应布局

标签:oat   doctype   左右   中间   type   tle   meta   round   div   

原文地址:http://www.cnblogs.com/chuanzhi946/p/6818746.html

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