[英]IE9 CSS layout issue
I am having some layout issues with IE9 and I can't seem to get to the root of it. 我在IE9上遇到一些布局问题,但似乎无法了解它的根源。 I am using Foundation 5 but I don't think that is the issue. 我正在使用Foundation 5,但我不认为这是问题。 I have this in a Foundation grid as large-12 so there is plenty of space. 我在12的Foundation网格中有这个,所以有足够的空间。
This is what it looks like in IE9; 这就是IE9中的样子; There shouldn't be a gap. 不应该有差距。
HTML (this is just the html for 2 cards/links): HTML(这只是2张卡片/链接的html):
<div class="linkPanel">
<div class="lastMod">
<span id="last_modified" class="thisDate">Wed, 17 Jun 2015 09:39:13 CDT</span>
<div class="newItem">
<i class="fa fa-bell"></i>
</div>
</div>
<a href="#">Claims Emergency Contact</a>
</div>
<div class="linkPanel">
<div class="lastMod">
<span id="last_modified" class="thisDate">Wed, 17 Jun 2015 09:39:13 CDT</span>
<div class="newItem">
<i class="fa fa-bell"></i>
</div>
</div>
<a href="#">Claims Emergency Contact</a>
</div>
And here is the CSS: 这是CSS:
.linkPanel {
width: 250px;
margin-bottom: 20px;
margin-right: 40px;
border-radius: 0;
background-color: #FFF;
box-shadow: 0 2px 2px 0 rgba(0,0,0,.16),0 0 2px 0 rgba(0,0,0,.12);
cursor: pointer;
float: left;
}
.linkPanel a {
padding: 14px 10px 0 19px;
}
.newItem {
float: right;
padding: 10px;
}
.thisDate {
display: none;
}
I can't seem to figure out what the issue is. 我似乎无法弄清楚问题是什么。 If you happen to see it or know of some specific IE9 bug that would cause this, I would appreciate any guidance. 如果您碰巧看到它或知道某些可能导致此问题的IE9错误,我将不胜感激。
I think it's a container / width thing. 我认为这是一个容器/宽度的东西。 It seems like you might be with holding some code (can we see parent items?), but this is what I would guess: 似乎您可能正在持有一些代码(我们可以看到父项吗?),但这是我的猜测:
What ever is the container wrapper for the 2-columns (or if you have one for each 1 column), add a width:
maybe even also add a min-width:
make sure it is declared by position:relative;
不管是2列的容器包装器(或者如果每1列有一个容器包装器),请添加一个width:
甚至还可以添加一个min-width:
确保它由position:relative;
声明position:relative;
so it's the stable wrapper of the 2-columns. 因此它是2列的稳定包装。 I'm assuming in IE-9 since things render slightly different, it could be resolving with not enough space, forcing that odd item up. 我假设在IE-9中,由于情况略有不同,因此可能无法解决足够的空间,从而迫使该奇数项目出现。 You can also try increasing the width of said wrapper by a few pixels, maybe allowing for enough for it to snap into place in IE-9. 您还可以尝试将上述包装纸的宽度增加几个像素,也许允许足够的厚度使其在IE-9中卡入到位。
I figured it out. 我想到了。 It wasn't a spacing issue. 这不是间距问题。 Plenty of room. 足够的空间。 To fix this I added a height to .linkPanel and that cleared it right up. 为了解决这个问题,我在.linkPanel上增加了一个高度,然后将其清除。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.