0

私のナビゲーション バーは中央に配置され、Firefox 22 と Chrome 27 では完全に機能しますが、IE 8 では機能しません。これが仕事に関連していなければ気にしませんが、私たちは IE を使用して立ち往生しています。ブラウザ間の互換性のための何らかのリソースはありますか、それともただの試行錯誤ですか??

CSS マークアップ

body
{
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    margin: 0;
    padding: 0;
}
.container
{
    width: 1004px;
    margin: 0 auto;
    text-align: center;
}
.navigation
{
    text-align: center;
    display: inline-block;
    list-style-type: none;
    text-align: center;
}
.navigation li
{
    float: left;
    width: 150px;
    position: relative;
}
.navigation li a
{
    color: #fff;
    display: block;
    padding: 8px 7px 8px 7px;
    text-decoration: none;
    border-top: 1px solid #F2861D;
    background: #262626;
    text-align: center;
    text-transform: uppercase;
}
.navigation li a:hover
{
    color: #F2861D;
}
.navigation ul
{
    position: absolute;
    left: 0;
    display: none;
    margin: 0 0 0 -1px;
    padding: 0;
    list-style: none;
    border-bottom: 3px solid #F2861D;
}
.navigation ul li
{
    width: 150px;
    border-top: none;
}
.navigation ul a
{
    display: block;
    height: 15px;
    padding: 8px 7px 13px 7px;
    color: #fff;
    text-decoration: none;
    border-top: none;
    border-bottom: 1px dashed #6B6B6B;
}
.navigation ul a:hover
{
    color: #F2861D;
}

HTML マークアップ

<div class="container">
    <div class="navigation">
        MY NAVIGATION
    </div>
</div>
4

1 に答える 1

0

ドキュメントの上部でこれを使用します。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

または、可能であれば:

.container{
   width:100%; //auto
   margin:0 auto;
   text-align:center;
}

関連する質問:

「margin: 0 auto;」の使用 Internet Explorer 8 で

于 2013-08-02T13:45:51.010 に答える