2012-04-24 3 views
1

私はこのスプライトマップを構築し、CSSで配置します。私はIEでプロトタイプを構築し、ボックスの位置付けはFFでオフになっています。あなたが見ることができるようにブラウザ間で一貫性のないレイアウトのためのIEとFFボックス解決策の配置

enter image description here

、IE 9の背景位置が正しく並んでいますが、Firefoxでは、リストアイテムの背景には、表示されますが、深刻なオフセット。

ここはこのレイアウトのCSSです。この矛盾を引き起こす可能性のある問題は誰にも見えますか?

#iconmenu #panel1c {left: 1px; background-position-x: -48px; background-position-y: -9px; no-repeat;} 
#iconmenu #panel2c {left: 119px; background-position-x: -48px; background-position-y: -87px; no-repeat;} 
#iconmenu #panel3c {left: 237px; background-position-x: -48px; background-position-y: -165px; no-repeat;} 
#iconmenu #panel4c {left: 354px; background-position-x: -48px; background-position-y: -241px; no-repeat;} 
#iconmenu #panel5c {left: 469px; background-position-x: -48px; background-position-y: -319px; no-repeat;} 
#iconmenu #panel6c {left: 586px; background-position-x: -48px; background-position-y: -397px; no-repeat;} 
#iconmenu #panel7c {left: 704px; background-position-x: -48px; background-position-y: -475px; no-repeat;} 
#iconmenu #panel8c {left: 821px; background-position-x: -48px; background-position-y: -553px; no-repeat;} 
#iconmenu #panel1c a:hover {background: url(<%=Url.Content("~/Images/sprite.png")%>) -48px -630px no-repeat;} 
#iconmenu #panel2c a:hover {background: url(<%=Url.Content("~/Images/sprite.png")%>) -48px -708px no-repeat;} 
#iconmenu #panel3c a:hover {background: url(<%=Url.Content("~/Images/sprite.png")%>) -48px -786px no-repeat;} 
#iconmenu #panel4c a:hover {background: url(<%=Url.Content("~/Images/sprite.png")%>) -48px -862px no-repeat;} 
#iconmenu #panel5c a:hover {background: url(<%=Url.Content("~/Images/sprite.png")%>) -48px -940px no-repeat;} 
#iconmenu #panel6c a:hover {background: url(<%=Url.Content("~/Images/sprite.png")%>) -48px -1018px no-repeat;} 
#iconmenu #panel7c a:hover {background: url(<%=Url.Content("~/Images/sprite.png")%>) -48px -1096px no-repeat;} 
#iconmenu #panel8c a:hover {background: url(<%=Url.Content("~/Images/sprite.png")%>) -48px -1174px no-repeat;} 
#iconmenu #panel8c { border-right:0px; } 
#iconmenu { width: 936px; height: 125px; position: relative; margin-left: 0px; border: solid 1px #ce8a59; border-radius: 15px; -moz-border-radius: 15px; -webkit-border-radius: 15px; border-radius: 15px; background-color: #f8efde; } 
#iconmenu li { width: 74px; height: 74px; position: absolute; padding-right: 20px; margin: 20px;margin-left: 22px;margin-right: 10px; top: -7px; background: url(<%=Url.Content("~/Images/sprite.png")%>) 0 0 no-repeat;display: block;list-style: none;border-right: 1px solid #d59d6e;} 
#iconmenu a { width: 73px; height: 72px; display: block; } 
#iconmenu a:hover { color: #edc07f; } 
#iconmenu span { font-family: Arial,Tahoma,Verdana;font-size: 10px;font-weight: bold;color: #cc8a5a;margin-top: 0px;padding-top: 9px;line-height: 1em;text-align: center;vertical-align: baseline;display: block;} 
.icon {height:70px; width:100px;} 
.iconMenuItem { float:left; width:117px; height:70px; border-left:1px solid #ce8a59; } 

そしてここにHTMLである:

<ul id="iconmenu"> 
          <li id="panel1c"><a href="#"></a><span>Production Dashboard</span></li> 
          <li id="panel2c"><a href="#"></a><span>Lorem Ipsum</span></li> 
          <li id="panel3c"><a href="#"></a><span>Lorem Ipsum</span></li> 
          <li id="panel4c"><a href="#"></a><span>Lorem Ipsum</span></li> 
          <li id="panel5c"><a href="#"></a><span>Lorem Ipsum</span></li> 
          <li id="panel6c"><a href="#"></a><span>Lorem IpsumExcel</span></li> 
          <li id="panel7c"><a href="#"></a><span>Lorem Ipsumnt Uploader</span></li> 
          <li id="panel8c"><a href="#"></a><span>Lorem Ipsumols</span></li> 
         </ul> 

ルックを取るためにありがとうございました!

EDIT - 完全な説明のために、上記のコードが生成します。最初のスクリーンショットはずっと年上のコードに基づいています。私は相違を見ることができます

enter image description here

+1

ないアイデアを使用。しかし、素晴らしい質問のために+1。 –

+0

lolは親切な言葉にとても感謝しています。ソリューションとほぼ同じくらい良い! – nocarrier

答えて

0

...

background-position-xと ``のbackground-position-y`は(FirefoxやOperaがサポートされていません。 and is not a standard W3C CSS property)。

ので、代わりの

background-position-x: -48px; background-position-y: -9px; 

使用

background-position: -48px -9px; 
+0

非常に興味深い...私は今すぐこれを与えるでしょう。感謝万円! – nocarrier

+0

A CHARMのように働いた!!本当にありがとう。私は明白なxとyを使いました。なぜなら、最初に来たものを忘れていたからです。 – nocarrier

+0

@shawnを手伝ってうれしい –

関連する問題