Diogo Cardoso
Diogo Cardoso

Reputation: 22257

CSS divs width 50% not working in IE

I'm unable to get this working in IE, the second child doesn't remain in the same line.

HTML:

<div class="outer">
  <div class="inner">left</div>
  <div class="inner">right</div>
</div>

CSS:

.outer
{
  width: 100%;
}

.inner
{
  float: left;
  width: 50%;
}

Upvotes: 0

Views: 3020

Answers (3)

Sergio Andrade
Sergio Andrade

Reputation: 324

if you have a set width in px, 50% works correctly.

CSS:

.outer{
width: 900px;
} 
.inner{
width: 50%
}

Upvotes: 0

riwalk
riwalk

Reputation: 14223

Change it to width: 49.9%. Well documented bug in IE.

Upvotes: 9

scrappedcola
scrappedcola

Reputation: 10572

Change your width's to 49% (or one to 50% and the other to 49%).

Upvotes: 3

Related Questions