如何浮动2 div在IE8中彼此相邻 [英] How to float 2 div's next to each other in IE8
问题描述
我有两个div,我想要彼此相邻显示它们。在正常的浏览器中没有问题。在IE,但是,事情搞砸了:
I have two div's and I want to show them next to each other. In normal browsers it's no problem. In IE however, things are messed up:
红色方块指出了我在说的div。左div具有类head_narrow,图像具有idbranche_header_image。
我的CSS看起来像这样:
The red squares point out the div's I'm talking about. The left div has the class "head_narrow", the image has the id "branche_header_image". My CSS looks like this:
.head_narrow {width:380px; float:left;}
#branche_header_image {float:right;}
两个div的宽度一起小于包装纸的宽度。发生了什么?
I am sure that the width of the two divs together is smaller than the width of the wrapper. What's going on?
推荐答案
在此ID中添加width#branche_header_image {width:400px; float:right;}
Add "width" in this id #branche_header_image {width:400px; float:right;}
或使用
display:inline;
而不是使用float。
for both divs instead of using float.
这篇关于如何浮动2 div在IE8中彼此相邻的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!