发表于: 2016-10-30 16:02:48
4 1308
今天学习了盒模型,display。
为什么九宫格排成一排了,求指导
<!doctype html>
<htnl>
<head>
<meta charset="utf-8">
<title>九宫格</title>
<style type="text/css">
#contain {
width:70px;
height:70px;
}
.box {
width:20px;
height:20px;
border:1px;
border-radius:5px;
background-color:#cc6600;
float:left;
margin:5px;
}
</style>
</head>
<body>
<div id="contain">
<div class="box">
</div>
<div class="box">
</div>
<div class="box">
</div>
<div class="box">
</div>
<div class="box">
</div>
<div class="box">
</div>
<div class="box">
</div>
<div class="box">
</div>
<div class="box">
</div>
</div>
</body>
</html>
评论