Welcome to WebmasterWorld Guest from

Forum Moderators: not2easy

Message Too Old, No Replies

IE div positioning woes

7:28 am on Nov 27, 2011 (gmt 0)

New User

10+ Year Member

joined:Mar 3, 2004
votes: 0

This is what I am using:

<div id="box" class="box" style="position:relative; width:650px; z-index:1 display:table-cell; vertical-align:top; margin-bottom: 50px;"> 
left col here

<div id="box" class="box" style="position:relative; width:300px; z-index:1 display:table-cell; vertical-align:top; margin-bottom: 50px;">
right col here

works brilliantly in Fox and Chrome,
but IE puts the second div vertically below the first div... (chrome/fox align them left to right)

so close... but yet so far, any suggestions?
3:59 pm on Nov 27, 2011 (gmt 0)

Senior Member

WebmasterWorld Senior Member penders is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:July 3, 2006
posts: 3123
votes: 0

style="position:relative; width:300px; z-index:1; display:table-cell; ...

You are missing a semi-colon (;) after the z-index rule that is preventing the following rule from being interpreted correctly.

However, it is still going to be a problem in IE7 and earlier (if that is of concern) as I don't believe it understands display:table-cell. For this you would probably need to float the columns.

Aside... may be a typo, but you have id="box" on both your elements.

[edited by: alt131 at 7:14 pm (utc) on Nov 27, 2011]
[edit reason] Switch off smile faces [/edit]