当我将div样式设置为display:block; float:right时,为什么在IE6中该div仍然会出现在文本下方,而不是像其他浏览器(包括IE7+)一样浮动到右侧的中间。如果我将display设置为inline,则div内部的菜单会混乱。我需要保持display:block的设置。
.content { display:block; }
.float { width:150px; display:block; float:right; }
.nothing { display:inline; }
请注意,在IE6中,float类不会显示在nothing类的右侧,而是出现在其下方。是否有解决方法?
输出结果如下:
.content { display:block; }
.float { width:150px; display:block; float:right; }
.nothing { display:inline; }
请注意,在IE6中,float类不会显示在nothing类的右侧,而是出现在其下方。是否有解决方法?
<span>This is some text </span>
<div style="float: right;">
This is floated text
</div>
输出结果如下:
这是一些文本 这是浮动的文本如果您将span向左浮动,或者
<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>
它正常工作:
这是一些文本 这是浮动文本