您的位置:首页 > 其它

class 1 模板&盒子模型

2016-10-11 21:37 134 查看
基础模板
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>随意</title>
</head>
<body>

</body>
</html>

盒子模型
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>随意</title>
<style>
body{
margin:10px;
padding:10px;
}
.uni{(uni—相同部分 以便减少代码)
width:200px;
height:200px;
float:left;(浮动:left左/right右)
}
#first{(#是id)
width:500px;
height:500px;
background:white;
margin:0 auto;
}
#second{
background:red;
margin-right:10px;
margin-bottom:10px;
}
#third{
background:green;
margin-bottom:10px;
}
#fourth{
background:black;
margin-right:10px;
}
#fifth{
background:blue;
}
</style>
</head>
<body>
<div id="first">
<div id="second" class="uni">(class定义为任意字母)
</div>
<div id="third" class="uni">
</div>
<div id="fourth" class="uni">
</div>
<div id="fifth" class="uni">
</div>
</div>
</body>
</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  盒子模型