IE7 img - a href,寻找解决方法
我遇到了这个问题,这是 IE7 中的一个恼人的错误。
img 周围的 href
声明“Boston Whaler”上方左侧换行符。
我无法找到解决方法。也许你们中的一些人这样做?
img {
float:left;
margin-right:5px;
margin-bottom:5px;
display:block;
}
我在这里重现了这个问题: http://bouwknecht.nl/ie7bug
I have this issue occurring, its an annoying bug in IE7.
The a href
around the img
claims a newline on the left right above 'Boston Whaler'.
I don't manage to find a workaround for this. Maybe some of you do?
img {
float:left;
margin-right:5px;
margin-bottom:5px;
display:block;
}
I reproduced the problem over here: http://bouwknecht.nl/ie7bug
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这里发现你的 CSS 规则有很多问题 - bouwknecht.nl/boten - 在你的列表元素内 < ;李>您有不应该浮动的浮动内容( 标签),我认为这意味着您想要将图像浮动到左侧,您需要将 浮动 的标记父级并为其指定与 内部相同的边距。不用说,从该 中删除任何样式。标签,div.price 的底部边距也很大,这有什么原因吗?你需要让
There are a lot of things wrong with your CSS rules found here - bouwknecht.nl/boten - inside your list elements <li> you have floating content ( the <img> tag ) which shouldn't be floating, I assume means you want to float your image to the left, you need to float the <a> tag parent of the <img> and give it the same margins as inside the <img> needless to say remove any styling from that <img> tag, also the div.price has a big bottom margin, is there a reason for this? you need to let the <li> element know you have floating elements inside and that the height needs to be recalculated maybe a clearfix type of solution works here, meanwhile overflow: hidden; works on the <li> element but going back to your div.price you will need to fix the margins since you are working with negatives, I tried fixing this with margin: 0; and it worked just fine, this might not be the "Answer for IE7" but once you fix your rules you will make sure every browser does it's best to conform to the spec, if you write bad code then browsers try to be smart and fix it for you using each its unique way thus working in some
在 IE7 中,如果您还将
float:left
应用于 h3 元素,它将与顶部对齐。在这种情况下,请确保将clear:both
应用于每个 li 元素。In IE7, if you also apply
float:left
to the h3 element, it will align to the top. In that case, make sure that you applyclear:both
to each li element.