2010-01-12 85 views
3

如何當我有一個div樣式顯示:塊; float:對,在IE6中,div仍然在文本之下,而不是在它的右邊。它適用於所有其他瀏覽器,包括IE7 +。我需要顯示塊,因爲如果我做內聯顯示,那麼div內的菜單全部搞砸了。CSS IE6浮動權

.content { display:block; }

.float { width:150px; display:block; float:right; }

。沒有{ display:inline; }

float類是不是沒有什麼類的權利,它在IE6下面,知道一個修復嗎?


我假設這是什麼意思:

<span>This is some text </span> 

<div style="float: right;"> 
    This is floated text 
</div> 

輸出是這樣的:

This is some text  
         This is floated text

如果你離開浮動跨度,或

<span style="float:left;">This is some text </span> 

<div style="float: right;"> 
    This is floated text 
</div> 

切換文本的順序和浮動

<div style="float: right;"> 
     This is floated text 
</div> 

<span>This is some text </span> 

它正常工作:

This is some text This is floated text
+0

也許你可以包含一些HTML並接受你以前的答案。 – metrobalderas 2010-01-12 06:22:04

+0

也許這屬於doctype.com? – 2010-01-12 06:38:11

+1

doctype上的類似問題:http://doctype.com/wierd-ie6-float-issue – Greg 2010-07-29 20:45:06

回答

0

這可能不是你的情況選擇,但也許你可以嘗試float: left與父元素align: right?這在過去對我來說很有效,但在每種情況下都沒有用。