1行3列实现代码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>1行3列实现代码</title>
<style type="text/css">
.abc{width: 500px;height: 300px;background: red;}
.a{float: left;width: 200px;height: 300px;background: blue;}
.b{float: left;width: 100px;height: 300px;background: green;}
.c{float: left;width: 200px;height: 300px;background: gray;}
</style>
</head>
<body>
<div class="abc">
<div class="a"></div>
<div class="b"></div>
<div class="c"></div>
</div>
</body>
</html>
1列多行实现代码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>1列多行实现代码</title>
<style type="text/css">
.a{width: 300px;height: 50px;background: blue;}
.b{width: 300px;height: 50px;background: green;}
.c{width: 300px;height: 50px;background: gray;}
</style>
</head>
<body>
<div class="a"></div>
<div class="b"></div>
<div class="c"></div>
</div>
</body>
</html>
实现一行3列的话可以使用浮动布局或者定位,实现一列多行的使用使用默认布局模式即可。