在Internet Explorer中打破导航菜单和色带

时间:2013-03-06 16:17:20

标签: html css internet-explorer

我目前在Internet Explorer中遇到两个问题。第一个是我的导航菜单:链接堆叠在彼此之上,而不是跨越栏。这是导航菜单的代码。

HTML

<div class="main-navigation" role="navigation" style="margin-top: 5px;">
<div class="nav-menu"><ul><li class="page_item page-item-8"><a href="http://tshirthideout.com/design-your-own/">design your own</a></li><li class="page_item page-item-10"><a href="http://tshirthideout.com/fan-photos/">fan photos</a></li><li class="page_item page-item-12"><a href="https://tshirthideout.com/win-a-free-t-shirt/">Win a free T-shirt</a></li></ul></div>
</div><!-- #site-navigation -->

CSS

.main-navigation li {
    margin: 0px 20px 0px 0px;
    position: relative;
    text-align: center;
    padding: 7px 0px;
}

    .main-navigation li ul {
        display: none;
        margin: 0;
        padding: 0;
        position: absolute;
        top: 100%;
        z-index: 1;
    }
    .main-navigation li ul ul {
        top: 0;
        left: 100%;
    }
    .main-navigation ul li:hover > ul {
        border-left: 0;
        display: block;
    }
    .main-navigation li ul li a {
        background: #efefef;
        border-bottom: 1px solid #ededed;
        display: block;
        font-size: 11px;
        font-size: 0.785714286rem;
        line-height: 2.181818182;
        padding: 8px 10px;
        padding: 0.571428571rem 0.714285714rem;
        width: 180px;
        width: 12.85714286rem;
        white-space: normal;
    }
    .main-navigation li ul li a:hover {
        background: #e3e3e3;
        color: #444;
    }
    .main-navigation .current-menu-item > a,
    .main-navigation .current-menu-ancestor > a,
    .main-navigation .current_page_item > a,
    .main-navigation .current_page_ancestor > a {
        color: #cb0000;
        font-weight: bold;
    }

第二个问题是我在侧栏中使用了两条标题。 右侧底部翻盖使其呈现环绕式外观并未显示出来。

HTML

<div class="ribbon"><strong>SPECIAL OFFERS</strong></div>

CSS

.ribbon {
padding-bottom: 7px;
padding-top: 8px;
    padding-left: 3px;
    color: #fff;
        text-shadow: 1px 1px 0px #c1c1c1;
        font-size: 15px;font-family:'Century Gothic',futura,'URW Gothic L',Verdana,sans-serif;
        letter-spacing: 5px;
position:relative;
    width:267px;

    right:0px;
    top:19px;
    background-color:#212121;
-moz-border-radius:2px 0px 0px 2px;  /*radius of 2px*/
-khtml-border-radius:2px 0px 0px 2px;
-webkit-border-radius:2px 0px 0px 2px;
-webkit-box-shadow: -2px 2px 4px rgba(50, 50, 50, 0.35);
-moz-box-shadow:    -2px 2px 4px rgba(50, 50, 50, 0.35);
box-shadow:         -2px 2px 4px rgba(50, 50, 50, 0.35);
}
.ribbon:after {
    content:'';
    width:0;
    height:0;

    border-color: #000 transparent transparent #000;
    border-style:solid;
    border-width:5px 5px;

    position:absolute;
    right:0;
    bottom:-10px;
}

此代码适用于其他主流浏览器,但不适用于IE。

1 个答案:

答案 0 :(得分:0)

对于第一个问题,您应该添加display: inline-block

的任何位置
zoom: 1;
*display: inline

更新

.main-navigation div.nav-menu > ul {
        border-bottom: 1px solid #ededed;
        border-top: 1px solid #ededed;
        display: inline-block !important;
            *display: inline
            zoom: 1;

        text-align: center;
        width: 100%;
    }

    .main-navigation li a,
    .main-navigation li {
        display: inline-block;
            *display: inline
            zoom: 1;
        text-decoration: none;

    }

来自您提供的link