2011-09-07 170 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