html - 非常奇怪的 IE7 float 影响 child 错误

标签 html css internet-explorer css-float

<div style="float:right;">
    <a href="#" class="button2" title="Upgrade now">Upgrade now</a> 
    <a href="#" class="button2" title="Buy more credits">Buy more credits</a>
</div>

float:right|left(无论是内联的还是在我的样式表中)似乎使链接失去了垂直填充和底部边框。如果我删除它,我没有问题。

这是链接的 CSS:

.button2 {
    color: #fff;
    font-size: 18px;
    text-shadow: 0 -1px 0 #064687;
    border: 0;
    border-bottom: 2px #0B5BAC solid;
    border-radius: 8px;
    background: #1E88F2;
    background: -moz-linear-gradient(top, #6BB0F7, #2089F2);
    padding: 9px;
    cursor: pointer;
    box-shadow: 0 2px 2px #999;
    text-decoration: none;
    width: 270px;
}

最佳答案

通过添加 zoom: 1; 尝试旧的 'hasLayout' 修复

.button2 {
    zoom: 1;
}

http://www.satzansatz.de/cssd/onhavinglayout.html

我不喜欢那样做 hack,但它似乎可以实现你想要的。

关于html - 非常奇怪的 IE7 float 影响 child 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18235204/

相关文章:

html - Outlook 2010 字体前景色/背景色 CSS 不能很好地配合

css - 绝对位置不允许我的链接显示

CSS li 元素在 IE7 中显示不正确

html - IE8 CSS 文本间距问题

javascript - 按钮未调用功能

javascript - jquery 脚本 : z-index and setTimeout 的两个问题

javascript - 如何使用 jQuery 获取在 HTML 页面中创建的所有跨度

javascript - 如何始终使用 flexbox 填充父高度?

css - CSS 样式表中不允许使用任何字符吗?

javascript - constructor.name 在 Internet Explorer 中未定义