尽管我使用了float,但我的两个div类并不想并排排列。怎么做? 基本上整个宽度是520px,每个框的宽度是250px,在20px的框之间有一个空白。并列两个div类
<div id="car-box">
<div class="well-car">
<div class="add_box">
<h1 class="add_heading">car model</h1>
</div>
</div>
<div class="car-brand">
<a class="button" href="www.placehold.it">car brand</a>
</div>
</div>
和CSS:
.car-box {
width:520px;
height:500px;
border:5px dashed blue;
margin-right:10px;
float:left
}
.well-car {
width:250px;
height:250px;
border:10px solid red;
}
.car-brand {
width: 250px;
height:250px;
border:10px dashed blue;
font-size: 20px;
float:left
}
这里小提琴...... Fiddle
似乎每个人都应该是'#car-box'而不是'.car-box'或'class =“car-box”'而不是'id' - 你拥有它的方式你根本没有设计外部div,所以它不* 520 *宽(但这不是唯一的问题) – CupawnTae