嗨我想中心在div中的4个图像。正如你所看到的,他们被困在左边。将div中的内容居中。保证金0,自动不起作用。也没有显示:内嵌
我想他们是完全中心与至少围绕它们一个5-10px余量理由(略向右移动)。 这只是我关心的这个部分...而不是HTML网站的其余部分。谢谢。 我的HTML是:
<section id="slide-6" class="homeSlide">
<div class="bcg">
<div class="hsContainer">
<!-- <div class="hsContent">-->
<div class="img">
<a target="_blank" href="">
<img src="http://fieldtelecommunications.com/images/telecommunications_equipment.jpg" alt="Klematis" width="280" height="280">
</a>
</div>
<div class="img">
<a target="_blank" href="">
<img src="http://fieldtelecommunications.com/images/telecommunications_equipment.jpg" alt="Klematis" width="280" height="280">
</a>
</div>
<div class="img">
<a target="_blank" href="">
<img src="http://fieldtelecommunications.com/images/telecommunications_equipment.jpg" alt="Klematis" width="280" height="280">
</a>
</div>
<div class="img">
<a target="_blank" href="">
<img src="http://fieldtelecommunications.com/images/telecommunications_equipment.jpg" alt="Klematis" width="280" height="280">
</a>
</div>
</div>
</div>
</div>
</section>
CSS是:
#slide-6 .bcg {
position: relative;
background-color: #efefef;
height:50%;
}
slide-6 .hsContent {
position: relative;
}
slide-6 .hscontainer {
width: 100%;
height: 100%;
display:inline;
overflow: hidden;
margin: 0 auto; position: relative;
}
div.img {
margin: 20px;
/*padding: 5px;*/
/*border: 1px solid #0000ff;*/
/*height: auto;
width: auto;*/
/*float: left;*/
display:inline;
}