views:

49

answers:

2

This seems to works in ie8, Chrome, and Firefox. Everything should be on the same line, but in ie7 the last div for some reason doesn't seem to "fit" and gets dropped down to the next line. Is there a simple way to get this to work with ie7?

<div style="width: 95%">

    <div style="width: 25%; background-color: blue; float: left;">test1</div>

    <div style="width: 25%;  background-color: green;float: left;">test2</div>

    <div style="width: 25%;  background-color: red;float: left;">test3</div>

    <div style="width: 25%;  background-color: yellow;float: left;">test4</div>

</div>
+3  A: 

you'll probably have to set them to 24.9%, as IE has issues with combined percentage widths of 100%.

meder
A: 

I tried the example with the added css: * {margin:0;padding:0;}

and It worked in IE7 for me.

Maybe you have a css error?

Zach Lysobey
hmmm... upon playing with resizing the window, sometimes this fails
Zach Lysobey