最新回答 / sunyaox
这没说吧:两个<div id="left"></div> <div id="right"></div>这两个元素如果在一行显示,就用浮动。在<body></body>中添加两个div 然后设置,宽度 高度 背景颜色,分别给这两个div设置颜色 试试吧
2015-12-11
最新回答 / Mr_Hui
body{ margin:0; padding:0; font-size:30px; color:#fff}.top{width:100%;height:80px;background:#ccc;}.main{width:600px;height:600px;margin:0 auto; background:red;position:relative;}.left{width:200px;height:600px;position:absolute;left:0;top:0; background:bl...
2015-11-22
最新回答 / 慕課君
意思就是块级元素默认宽度是100%,你想看到的是块里的元素居中,那就不能用margin,要是单纯想块居中,就要把块容器限制一个宽度。如果是想让块内元素居中的话,那就用text-align:center。
2015-11-20
最新回答 / Cassiel422
.foot{ width:800px; height: 100px; background-color: #900; margin:0 auto; clear: both;}
2015-11-13