PDA

View Full Version : Internet Explorer 8 and inline(-block)



mirv
17 Aug 2009, 03:24 AM
Hi,
I was wondering if anyone could help me understand or figure this out ...

I have the code below trying to display 2 div's next to eachother within a container div, I've done quite a bit of googling and found that I should set the style to inline if the browser is IE. No matter what I try I cannot seem to get this to work in IE8!

I'd glady appreciate any input or suggested reading on this as far as IE8 compatibility (I've never had so many problems as with IE8).


<style type="text/css">


#container div {
display:-moz-inline-box;
display: inline-block;
}
#container {
width:600px;
border: 1px solid;
}

</style>
<!--[if lt IE 8]>
<style type="text/css">
#container div { display:inline; }
</style>
<![endif]-->
<div id="container" >
<div >content1</div><div>content2</div>
</div>