导航栏IE7很难过

时间:2013-08-30 10:36:37

标签: html css internet-explorer cross-browser

在IE7中显示时,我的导航栏是一个悲惨的混乱。我对这种遗留编码不太感兴趣,从我读过的内容来看,伪状态,z索引和绝对位置都存在问题。

我尝试了各种各样的事情,让它做出正确反应,但没有快乐。

我也尝试过使用

<!--[if IE 7]>
<script src="http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE7.js"></script>
<![endif]-->

因为我的印象会有所帮助,但问题仍然存在。

非常感谢任何帮助。

<aside>
    <div class="module blue">
        <h2 class="wtf">Index<a href="../index.php">Select</a></h2>
        <br/>
        <h2 class="wtf">Admin Home<a href="../admin.php">Select</a></h2>
    </div>
</aside>

css:

aside { display: block; }

h2 {
    font-size: 26px;
    position: relative;
}

aside {
    padding-top:10px;
    width: 18%;
    float: left;
    min-width:250px;
}

.navMenu{
    display:block;
    padding-top:10px;
    width: 18%;
    float: left;
    min-width:250px;
}

.module {
    background: #eee;
    margin: 0 0 10px 0;
}
.module h2 {
    background: #ccc;
    line-height: 2;
    padding: 0 0 0 10px;
    font-size: 16px;
    margin: 0 0 4px 0;
    box-shadow: inset 0 25px 10px -10px rgba(255, 255, 255, 0.2);
}
.module h2 a {
    float: right;
    position: relative;
    text-decoration: none;
    color: #333;
    padding: 0 10px;
        border-left: 5px solid white;
        -webkit-transition: padding 0.1s linear;
        -moz-transition: padding 0.1s linear;
        -ms-transition: padding 0.1s linear;
        -o-transition: padding 0.1s linear;
    }

    .module h2 a:hover {
        padding: 0 14px;
    }
    .module h2 a:active {
        padding: 0 16px;
    }

    .module h2 a:before,
    .module h2 a:after {
      content: "";
    position: absolute;
        top: 50%;
        width: 0;
        height: 0;
    }
    .module h2 a:before {
        left: -12px;
        border-top: 8px solid transparent;
        border-bottom: 8px solid transparent;
        border-right: 8px solid white;
        margin-top: -8px;
    }

    .module.blue h2 a {
        background: #a2d6eb;
    }
    .module.blue h2 a:hover {
        background: #c5f0ff;
    }
    .module.blue h2 a:after {
        left: -5px;
        border-top: 6px solid transparent;
        border-bottom: 6px solid transparent;
        border-right: 6px solid #a2d6eb;
        margin-top: -6px;
    }
    .module.blue h2 a:hover:after {
        border-right-color: #c5f0ff;
    }

感谢您的帮助!

1 个答案:

答案 0 :(得分:0)

希望这可以帮助别人。

在我的例子中,H2标签上的相对定位造成了严重破坏。

我在IE中通过开发模式工作,直到我能够获得结果我被淘汰,将代码弹出到新的css文件中并使用IF IE条件调用该样式表。

它不像以后的版本那么好,但是它的视线更好:)

感谢所有帮助过的人

相关问题