在以下 HTML 中,.left 具有 float:right,不能更改。是否仍然可以将 .right div 移动到右侧而不更改 .left div 中的 float:right ?
HTML:
<div class="box">
<div class="wrap">
<div class="left">This should be left.</div>
</div>
<div class="right">This should be right</div>
</div>
CSS:
.box{
width: 300px;
overflow: hidden;
border: 1px solid red;
}
.left{
width: 100px;
float: right; /* cannot change */
border: 1px solid blue;
}
.right{
width: 100px;
float: right;
border: 1px solid green;
}
演示:http: //jsfiddle.net/y5UEu/