我总共有7个div,其中1个被指定为中间。对齐中心div的左右div div
它应该是这个样子:
我拿到前两名图片和刀正确对齐,但对方并没有出现我多么希望他们。
这里的CSS:
.vegetablewrapper {
width: 100%;
overflow: hidden;
background-color: white;
}
.vegetableleft {
float: left;
width: 350px;
padding: 5px;
margin-left: 5px
}
.vegetableright {
float: right;
width: 345px;
padding: 5px;
margin-right: 8px;
}
.vegetablemiddle {
float: left;
width: 200px;
padding: 5px;
}
和HTML:
<div class="vegetableleft">
<img src="bilder/leek.jpg" alt="leek"/>
</div>
<div class="vegetablemiddle">
<img src="bilder/knife.jpg" alt="knife"/>
</div>
<div class="vegetableright">
<img src="bilder/leekcut.jpg" alt="leek cut"/>
</div>
<div class="vegetableleft">
<img src="bilder/onion.jpg" alt="onion"/>
</div>
<div class="vegetableright">
<img src="bilder/onioncut.jpg" alt="onion cut"/>
</div>
<div class="vegetableleft">
<img src="bilder/carrot.jpg" alt="carrot"/>
</div>
<div class="vegetableright">
<img src="bilder/carrotcut.jpg" alt="carrot cut"/>
</div>
</div>
在给定的代码我的网站看起来是这样的:
这怎么可能正确呢?
提供实时链接将更有助于我们帮助您 –
我怀疑通过“提供链接”您是指实际网站?主帖中的代码应该足够了,但是这里是我的网站的链接:http://bit.ly/RNinCm 感谢您的回复。 – user1736049