2010-10-07 118 views
0

我花了幾個小時試圖讓這項權利,但它只是不爲我工作....正如你可以在圖片中看到: alt text導航不會右對齊

導航僅僅是不對。也許你可以幫助我?該網站是http://elektrikhost.com ....我用Web dev的擴展前面的Firefox爲指導線...我不知道爲什麼它只是不會爲我工作....繼承人的CSS:

nav { background: #282828 url(../images/nav-bg.png) repeat-x; border-radius: 6px; -webkit-border-radius: 6px; -moz-border-radius: 6px; -o-border-radius: 6px; margin: 24px auto; width: 822px; } 
nav ul { padding: 13px 0; } 
nav ul li { background: url(../images/nav-sep.jpg) left center no-repeat; display: inline; padding: 0 39px; margin: 0 auto; } 
nav ul li:first-of-type { background: none; } 
nav ul li:last-of-type { /*background: url(../images/ref2.png)*/ no-repeat right bottom; margin: 10px 0 0 0; } 
nav ul li a { color: #626262; font: 1.2em Arial, Helvetica, serif; } 
nav ul li a:hover { color: #dfdfdf; } 

感謝您的幫助...

+0

稍微偏離主題。我發現你使用的是HTML5。我建議你在大多數人開始使用它之前不要使用HTML5。我正在使用我的辦公系統與Firefox 3和IE 7,並發現該網站完全錯位。 IE 7不支持'

+0

您可以使用javascript使IE支持HTML5元素 – pixeltocode 2010-10-07 08:35:39

+0

出於某種原因,在我的MacBook上,在Chrome中,底部會出現不必要的水平滾動條。 – 2010-10-07 08:43:30

回答

1

您的#main-wrap是897px寬,而nav是822px寬,margin : 24px auto。所以,「extra」75px正在分散並導致問題。要麼使nav 897px寬,要麼相應地調整邊距。

使用HTML5元素的重點是更多的語義。如果您決定使用它們,請一路走下去並取消<div>並改用<section>。爲了讓IE支持HTML5元素,請點擊以下鏈接

http://remysharp.com/2009/01/07/html5-enabling-script/

http://html5doctor.com/how-to-get-html5-working-in-ie-and-firefox-2/

希望這會有所幫助。

1

在螢火蟲中添加float:right;nav確實幫我把它移到右邊。這是你想要的嗎?

0

此致風格是:

.plan-wrap 
{ 
margin: 0px 0px 0px 3px; 
width: 897px; 
} 

我的是這一點,它爲中心,我就好了:

.plan-wrap 
{ 
margin: 0px 0px 0px 10px; 
width: 897px; 
} 

這是你需要什麼?

+0

不,我需要的導航與計劃完全一致 – omnix 2010-10-07 05:47:20

+0

我認爲這是計劃錯位,而不是導航。我不確定,這可能是我的瀏覽器的問題。 – 2010-10-07 06:03:38

0

你可能想重新考慮你的內容包裝。也許包括導航和計劃在一起,並有100%的寬度。