Rumah >hujung hadapan web >html tutorial >css右边乱跑了?_html/css_WEB-ITnose
CSS代码:
a {color:#252525; text-decoration:none;}a:visited {text-decoration:none;}a:hover {color:#ba2636;text-decoration:underline;}a:active {color:#ba2636;}.bigBox {margin: 0 auto; width: 850px;margin:auto;clear:both;}.left {padding:5px; float: left; width:65%;background:#FFF;height:300px;margin:auto;border-radius: 5px;border:1px solid #e1e2e3;clear:both;}.right {clear:both;float: right; width: 32%;background:#F7f7f7;height:300px;margin:0px;padding:0px;word-break:break-all;}.div_right{padding:5px;}
<div class="clear"></div><div class="bigBox clearfix"> <div class="left">左边</div> <div class="right"><div class="div_right">如何在右边?如何在右边?如何在右边?如何在右边?如何在右边?如何在右边?如何在右边?如何在右边?</div></div></div><div class="foot"></div>
clear:both; 去掉
.right {
float: right; width: 32%;
background:#F7f7f7;
height:300px;
margin:0px;
padding:0px;
word-break:break-all;
}