【发布时间】:2016-04-30 02:59:08
【问题描述】:
我在图像的底部和右侧有一个奇怪的间距,我想将其删除。我已将填充和边距设置为 0px,但它仍然显示。这很烦人,因为我希望图像以零间距整齐地装入外框,以获得像素完美的外观。
img.news_title_icon {
width: 80px;
height: 80px;
padding: 0px; margin: 0px; border: 0px;
}
body {
width: 800px;
margin: auto;
margin-top: 50px; /* for testing */
padding: 0px;
font-family: arial, helvetica, sans-serif;
font-size: 11pt;
background-color: #001133;
color: white;
}
div.news_title_container {
margin-bottom: 5px;
}
.light_container, .dark_container {
-webkit-box-shadow: 0px 0px 4px 2px rgba(0,0,0,0.57);
-moz-box-shadow: 0px 0px 4px 2px rgba(0,0,0,0.57);
box-shadow: 0px 0px 4px 2px rgba(0,0,0,0.57);
border: 1px solid #005eff;
}
.light_container {
background-color: rgba(0, 34, 102, 0.8);
}
<div class="news_title_container light_container">
<img class="news_title_icon" alt="an image">
<img class="news_title_icon" alt="an image">
<img class="news_title_icon" alt="an image">
</div>
有人可以帮忙吗?谢谢!
【问题讨论】: