關于margin居中縮寫問題
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>一列布局改混合三列布局</title>
<style type="text/css">
body{margin:0;padding:0;}
.top{height:200px;background:#00F;}
.main{width:300px;height:800px;background:#0FF;margin:10 auto;}
.bottom{width:300px;height:200px;background:#999;margin:0 auto;}
</style>
</head>
<body>
? ? <div class="top"></div>
? ? <div class="main"></div>
? ? <div class="bottom"></div>
</body>
</html>
在給中間的main居中?時,代碼"margin:0?auto"可以使main居中,,我用“margin-top:10px;margin-left:auto;margin-right:auto;”可以居中,還會在main上方空出10px,但是我用“margin:10?auto;”為什么就不能居中了?
2016-10-04
margin:10 auto; ? 這里,10后面沒寫單位
margin:10px auto;
2016-07-03
截圖與問題無關