Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-09-2011, 08:48 PM   PM User | #1
johnmerlino
Regular Coder

 
Join Date: Oct 2009
Posts: 189
Thanks: 38
Thanked 3 Times in 3 Posts
johnmerlino is an unknown quantity at this point
Floating issue in IE

Hey all,

I am having a floating issue in IE 8 with this site:

http://hllawgroup.com/home

The divs involved are the following:

#wrapper div 980px

#main div 698px
25px padding on left and right

so 698 + 25 + 25 = 748px

#panel div width 230px and border left and right 1px
so 230 + 1 + 1 = 232px

748 + 232 = 980px

which is the width of the wrapper

This works fine on Google Chrome, Firefox, and Safari.

However, on IE 8 and probably all other version of IE, something strange happens.

1) On the home page, the #main div drops below the #panel div, as if the main div is too wide to fit within the wrapper, but math above shows this behavior shouldn't happen

2) If you go to the about page, you will notice the opposite occurs. You notice that the #main div is not snuggled up against the #panel div, but rather there is a gap between them. But the math above shows that there should be no gap. So between the home and about pages, in IE, two very strange behaviors occur.

If you look at the page on Google Chrome, you will see what I was trying to do.

Thanks for response
johnmerlino is offline   Reply With Quote
Old 06-10-2011, 12:51 AM   PM User | #2
TogetherWeRise
New Coder

 
Join Date: May 2011
Posts: 35
Thanks: 2
Thanked 0 Times in 0 Posts
TogetherWeRise is an unknown quantity at this point
Add "Margin: 0px" and "Padding: 0px" to all div's that don't have a preset nonzero padding/margin value applied.

The reason it drops below there is because the width of the content on the line is greater than the preset width of the wrapper, so it goes to the next line. There is probably a padding/margin somewhere on one of those divs that IE is adding to make it overflow like this.
TogetherWeRise is offline   Reply With Quote
Old 06-10-2011, 03:31 AM   PM User | #3
teedoff
Senior Coder

 
Join Date: Aug 2010
Location: High Point, NC
Posts: 3,325
Thanks: 5
Thanked 363 Times in 360 Posts
teedoff is on a distinguished road
Try decresing your padding-right on the main div.

Also, dont know why you would center your centent the way you have when all you need is:

Code:
#wrapper {
        margin: 0 auto;
        width: 980px;
}
margin: 0 auto will center your content as long as you specify a width less that its container(in this case that would be body). You dont need positioning or negative margins at all.
__________________
Teed
teedoff is offline   Reply With Quote
Reply

Bookmarks

Tags
floats, internet explorer, width

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:12 AM.


Advertisement
Log in to turn off these ads.