<分区>
<分区>
我在图像的底部和右侧有这个奇怪的间距,我想将其删除。我已将填充和边距设置为 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>
有人可以帮忙吗?谢谢!
最佳答案
内联 block 有这个问题。更多详情 read this 有几种方法
例如,这不是您的问题。
<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>
关于css - 如何删除 CSS 中 <image> 周围的间距?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34964851/