html - IE9 问题 : Text in div is aligned to bottom

标签 html css internet-explorer

我有由  |  分隔的 anchor 。这一切都包装在 div.linksWrapper 中。在 IE9 中,作为 div.linksWrapper 直接后代的任何文本(在本例中为  | )都偏离其他元素的中心。在所有其他浏览器中, |  呈现与 anchor 对齐。

见下图...

enter image description here

html

<div class="instagramViewerWrapper">
    <div class="linksWrapper">
        <a class="active" href="#">VIEW ALL</a>&nbsp;|&nbsp;
        <a id="40020931" href="#" class="">KATHERINE</a>&nbsp;|&nbsp;
        <a id="40027696" href="#" class="">MELISSA</a>&nbsp;|&nbsp;
        <a id="42768724" href="#">MICHELE</a>&nbsp;|&nbsp;
        <a id="42764826" href="#">CAILEE</a>&nbsp;|&nbsp;
        <a id="42767242" href="#">CHRISTIE</a>&nbsp;|&nbsp;
        <a id="42763829" href="#">JAMIE</a></div>
    <div class="grid" id="instagramViewer">...</div>
</div>

CSS

html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, code, em, img, small, strike, strong, sub, sup, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {
    background: none repeat scroll 0 0 transparent;
    border: 0 none;
    font-size: 100%;
    margin: 0;
    outline: 0 none;
    padding: 0;
    vertical-align: baseline;
}
.instagramViewerWrapper {
    color: #888888;
    margin-top: 30px;
    min-height: 1040px;
}
.instagramViewerWrapper .linksWrapper {
    position: relative;
    text-align: center;
}
.instagramViewerWrapper .linksWrapper a {
    color: #888888;
    display: inline-block;
    padding-bottom: 5px;
}

最佳答案

这仅仅是因为您在 anchor 上应用了 padding-bottom: 5px; (.instagramViewerWrapper .linksWrapper a)。显然其他浏览器会忽略它,但 IE 不会。

要么移动规则声明以包含所有 .instagramViewerWrapper .linksWrapper,要么将其完全删除。

希望对您有所帮助!

关于html - IE9 问题 : Text in div is aligned to bottom,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12266796/

相关文章:

asp.net - IE 不呈现 ASP.net 下拉样式

html - 表格单元格内绝对定位的伪元素不覆盖 IE9/10 中的父元素

java - 当我在电子邮件客户端中设置阻止 HTML 电子邮件时会发生什么

javascript - 为什么脚本类型前面有 "text/"?

JavaScript 引起的样式更改不是永久性的

html - 在 R 中进行网络抓取时如何修复 HTTP 403 错误?

css - 自动换行后的边距将被忽略

html - 缩小浏览器时,CSS组按钮div脱离行和列

html - 如何使用 Bootstrap 均匀间隔 3 个选择框的内联?

javascript - 更新 xlink :href for a <use> element 时,Internet Explorer 无法正确绘制 SVG