Forum Moderators: not2easy

Message Too Old, No Replies

Horizontal aligned divs, IE7 issue

         

madmatt69

2:04 am on Nov 4, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi all,

I normally don't have trouble with this, but this one is starting to bother me.

Two divs horizontally aligned. So I do the standard 'wrapper' dive, and put the two divs in side of that and float each left and right.

---
.wrap{height:85px;width:100%;border-left:solid 1px #000;border-right:solid 1px #000}
.pc2 {height:85px;width:85%;float:left;}
.pc3{height:85px;width:15%;float:right;}
---

Works fantastic in FF, but IE7 is having none of it, displaying the right float a line below.

The html looks something like:
<div class="wrap">
<div class="pc2">content</div>
<div class="pc3">content on the right</div>

Can anyone help me out with this?

Thanks!

Marshall

2:24 am on Nov 4, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Depending on your margin and padding settings for pc2 and pc3, your total will exceed 100%. Also, I am not sure if the border you have on the wrapper makes that exceed 100%, so you might want to make it 99% wide. Again, this too is influenced by margins and padding.

Marshall