已采纳回答 / socratesT
.left{width:200px;height:500px;background:yellow;left:0;top:0;position:absolute; }.right{height:500px;background:#9ACC99;margin:0 auto 0 210px;}
2015-12-05
已采纳回答 / wlf1112
<...图片...>如上图所示的三列布局,右边right宽度为300px,则中间main距离窗口右边的距离为300px才能刚好不覆盖在right图片上,又要与右边距离10px,则其距离浏览器右边框的距离为310px;左边同理,希望可以帮助你理解
2015-12-05
已采纳回答 / 木子舟义
.main{background:red;}.main:after{ visibility: hidden; display: block; font-size: 0; content: " "; clear: both; height: 0;}.left{background:#00f;float:left;width:50%;}.right{background:#1d9;float:right;width:50%;}
2015-12-04
div{ text-align:center; line-height:50px ; position:absolute;}
.main{ width:960px; height:600px; margin:0 auto}
.left{ width:300px; height:600px; background:#ccc; float:left;}/*左浮动样式*/
.right{ width:660px; height:600px; background:#FCC; float:right; position:relative; left:30px;}/*右浮动样式*/
.main{ width:960px; height:600px; margin:0 auto}
.left{ width:300px; height:600px; background:#ccc; float:left;}/*左浮动样式*/
.right{ width:660px; height:600px; background:#FCC; float:right; position:relative; left:30px;}/*右浮动样式*/