网上看到很多都是绝对定位法,margin负值法,自身浮动法,但是全部浮动设置百分比也行,不知道这种有没其他问题;
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<title>Title</title>
<style>
div{
float: left;
}
.left,.right{
background: #000;
width: 30%;
height: 50px;
}
.mid{
height: 50px;
width: 40%;
}
</style>
</head>
<body>
<div class="left"></div>
<div class="mid"></div>
<div class="right"></div>
</body>
</html>
相关分类