0

1 div 幅の複数の背景画像を使用していますが、IE8 では機能しません。ここに私のcssコードがあります:

.description-page #main-navigation ul{ 
   text-align:left;
   width: 451px;background:url(../images/menu-desing.png) no-repeat center 26px ,
                           url(../images/top-bar1.png) no-repeat center 0px ;
   height: 86px; z-index:100;padding-top: 9px;
}

この問題の解決策はありますか?

4

2 に答える 2

1

CSS3pie を使用してこれを実現できます - http://css3pie.com/documentation/supported-css3-features/#pie-background

于 2013-02-12T14:58:09.227 に答える
0

IE8 でも 2 つの背景を実現するために、次のようなことを行うことができます: DOM に必要な要素は 1 つだけです。2 つ目の要素は、IE8 (IE7 ではなく) で既に機能する疑似要素を使用して作成します。

.description-page #main-navigation ul { 
   text-align:left;
   width: 451px;
   background:url(../images/menu-desing.png) no-repeat center 26px;
   height: 86px; 
   padding-top: 9px;

   position: relative;
   z-index: 1;
}

/* Generate a new element with the second background, positioned on the same place like the original ul */
.description-page #main-navigation ul:before {
     background: url(../images/top-bar1.png) no-repeat center 0px;
     content: "";
     height: 86px;
     left: 0;
     position: absolute;
     top: 0;
     width: 451px;

     z-index: -1;
}
于 2013-02-12T15:07:59.930 に答える