為什么盒中填充內容box1不會居中,總是在盒子的一角?
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>邊距</title>
<style type="text/css">
div{
? ? width:300px;
? ? height:300px;
border:1px solid red;
}
#box1{margin-bottom:30px;
}
</style>
</head>
<body>
? ? <div id="box1">box1</div>
? ? <div id="box2">box2</div> ??
</body>
</html>
2015-07-23
我的出現了哦,你在看看你的代碼
2015-07-22
要想居中可以使用 margin:0 auto;