2011-09-07 167 views
0
<fieldset style="background-color:#5959DE"> 
<span> <a href="page2.html"> <strong> Profile </strong> </a> </span> 
<span class="profilee"> <a href="page2.html"> <strong> Friends </strong> </a> </span> 
<span class="profilee"> <a href="page2.html"> <strong> Pictures </strong> </a> </span> 
<span class="profilee"> <a href="page2.html"> <strong> Updates </strong> </a> </span> 
<span class="profilee"> <a href="page2.html"> <strong> Messages </strong> </a> </span> 
<span class="profilee"><a href="page2.html"> <strong> Find  </strong> </a> </span> 
<input type=text size="20"/> 
<span style="padding-left:2%"> <a href="page2.html"> <strong> Privacy</strong> </a>  </span> 
<span class="profilee"> <a href="page2.html"> <strong> Availability</strong> </a> </span> 
<span class="privacy"> <a href="page2.html"> <strong> Sign Off </strong> </a> </span> 
</fieldset> 

問題我面臨的是它在Mozzilla和iE中的工作正常,但在谷歌瀏覽器中,標誌關閉跳到下一行。谷歌瀏覽器的問題?

我用

width:100%; width:100px; <!-- I mean I used % and px and em but none working--> 

但它仍然無法正常工作。爲什麼它跳到谷歌瀏覽器的下一行?我怎麼能把它放在一條線上,即使在谷歌瀏覽器上?

+0

工作正常,我在Chrome 13 http://jsfiddle.net/ –

+0

@Ben:http://jsfiddle.net/8nJe7/ ftfy – mpen

回答

0

請更新您的問題與一些更多的細節。包裝元素的外觀如何?什麼屬性是所有類(class="privacy"等)。您還在哪裏測試width:100%; width:100px;

我想這個問題與包裝元素的寬度有關,因爲你擁有的所有元素(span, a, strong, input)都是inline elements。這意味着所有元素都將像文檔中的普通文本一樣行爲,填充一行直到完整,然後繼續下一行。這是如果你還沒有在你的CSS中指定任何東西。

你能提供一個屏幕?

嘗試增加寬度fieldset(也許像350px)。

最後一個註釋。 fieldset元素用於定義表單的集合。不是菜單,有look here

+0

現在,它的工作我已經做了一些修改爲u建議〜 – niko