css - Slicing a box IE7间距问题

标签 css slice

我正在尝试用圆 Angular 切割一个盒子。图像被水平切成 3 部分(顶部-中间-底部)。 IE7的问题是top div比我设置的实际尺寸大。

这是 HTML 和 CSS 代码

<!-- FIRST PICTURE -->
  <div class='recent-box'>
    <div class='recent-box-top'></div>
    <div class='recent-box-middle' >                            
    </div>
    <div class='recent-box-bottom'></div>     
   </div>
   <!-- FIRST PICTURE -->
  <div class='recent-box'>
    <div class='recent-box-top'></div>
    <div class='recent-box-middle'>

    </div>
    <div class='recent-box-bottom'></div>     
   </div>
   <!-- FIRST PICTURE -->
  <div class='recent-box'>
    <div class='recent-box-top'></div>
    <div class='recent-box-middle'>
    dsqd
    </div>
    <div class='recent-box-bottom'></div>     
   </div>
   <!-- FIRST PICTURE -->
  <div class='recent-box'>
    <div class='recent-box-top'></div>
    <div class='recent-box-middle'>
    dsqd
    </div>
    <div class='recent-box-bottom'></div>     
   </div>


    .recent-box {
    width: 127px;
    float:left;
 display:block;
}

.recent-box-top {
    float:left;
    background-image: url('images/recent-foto-top.png');
    background-repeat:no-repeat;
    width: 100%;

}

.recent-box-middle {
    float:left;    
    background-image: url('images/recent-foto-middle.png');
    background-repeat:repeat-y; 
    width: 100%;

}

.recent-box-bottom {
    float:left;    
    background-image: url('images/recent-foto-bottom.png');
    background-repeat:no-repeat; 
    width: 100%;

}

谢谢你帮助我! 病房

最佳答案

font-sizeline-height 属性可能是令人反感的。如果您没有在顶部框中放置任何文本,请使用类似

.recent-box-top {
    font-size: 0;
    line-height: 0;
}

关于css - Slicing a box IE7间距问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4545177/

相关文章:

javascript - 为什么 slice 方法在此代码中包含 end 参数?

html - 无法将图像类标签居中

javascript - 如何将 HTML div 排列成一行,如结构?

css - 用于构建 DOM/CSS 类引用的软件

css - 当滚动内容超出固定背景时

perl - 哈希 perl 的切片哈希

python - 切片 : Generates a list of lists [a, b,c,...z] = [z], [y,z]

Python:如何将特定数量字符的字符串切片到列表中?

javascript - jquery $ selector 在 querySelector 不可用之前是如何定义的?

python - Django:在 "form.is_valid"之前切片表单数据