IE 5.5 div not centered

This is a discussion on "IE 5.5 div not centered" within the Web Page Design section. This forum, and the thread "IE 5.5 div not centered are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Mar 27th, 2007, 21:33
SuperMember

SuperMember
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
IE 5.5 div not centered

Since I have a <div> that is 770 pixels wide but also has padding of 50 pixels on right and left, I need some type of hack to center this div for IE 5.5 because it doesn't like the padding.

I read that I should use
Code: Select all
#seal { \width: 770px; } /* for IE5/Win */
But it messes up all the current browsers.

Could someone tell me how to correctly use the hack?

I can't post the site because I don't want it to show up in SE's.
The css code I have now is
Code: Select all
#content {
	background: url(graphics/back_container.jpg) 0px 186px;
	width: 670px;
	margin: 0 auto;
	padding: 15px 50px 0px 50px;
	clear: both;
	text-align: left;
	}
What could I include to get IE 5.5 to like this?
Thanks in advance!
Reply With Quote

  #2 (permalink)  
Old Mar 27th, 2007, 21:41
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: IE 5.5 div not centered

Add text-align: center; to the parent div.

So ... if #content is child of body then

Code: Select all
body {
  text-align: center;
}

 #content {
    background: url(graphics/back_container.jpg) 0px 186px;
    width: 670px;
    margin: 0 auto;
    padding: 15px 50px 0px 50px;
    clear: both;
    text-align: left;
    }
Reply With Quote
  #3 (permalink)  
Old Mar 27th, 2007, 21:50
SuperMember

SuperMember
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: IE 5.5 div not centered

Sorry Karinne, I do have that. The parent is centered.

I think I need to work around the padding issue. IE 5.5 doesn't like padding.
Reply With Quote
  #4 (permalink)  
Old Mar 27th, 2007, 22:44
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: IE 5.5 div not centered

Nesting div's is really the only solution to "fixing" the box model in IE.
Reply With Quote
  #5 (permalink)  
Old Mar 28th, 2007, 12:03
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: IE 5.5 div not centered

Linda ... if you didn't figure it out yet, give us a link ... if not ... post the answer
Reply With Quote
  #6 (permalink)  
Old Mar 28th, 2007, 12:59
SuperMember

SuperMember
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: IE 5.5 div not centered

I haven't actually used the hack but the box hack can be found here.

I can't post the link because it's for a State Representative. I can't take the risk of having it show up in Google under webforumz.

I think I'm going to have to implement the box hack because I would imagine many of her visitors are going to be older and possibly still using IE 5.5. Thoughts?
Reply With Quote
  #7 (permalink)  
Old Mar 28th, 2007, 13:14
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: IE 5.5 div not centered

OK .. well ... can you at least give us more code?
Reply With Quote
  #8 (permalink)  
Old Mar 28th, 2007, 13:48
SuperMember

SuperMember
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: IE 5.5 div not centered

Here's the html revised a bit to take out any info
Code: Select all
<div id="header"><h1>Client Name here</h1>    
    <ul id="navigation">
        <li><a href="/" class="selected">Home</a></li>
        <li><a href="bio.html">Bio</a></li>
        <li><a href="blog.html">Blog</a></li>
        <li><a href="contact.html">Contact</a></li>
    </ul>
</div>    
<div id="content">
  <p><span class="boldtext">Client name</span>, a 1969 graduate Blah</p>
 
  
</div>
<div id="seal"></div>
<div id="footer">&quot;Tagline here&quot;</div>
The div in red is the part that is not aligning in IE 5.5.

The css for it is:

Code: Select all
* {
    margin: 0;
    padding: 0;
}

html {
    background: #dadada url(graphics/background_page.jpg) repeat-x 0 0;
    }

body {
    margin: 0 auto;
    text-align: center;
    
    }

#header {
    background: url(graphics/header.jpg) no-repeat;
    height: 184px;
    width: 790px;
    margin: 0 auto;
    text-align: left;
    }

#content {
    background: url(graphics/back_container.jpg) 0px 186px;
    width: 670px;
    margin: 0 auto;
    padding: 15px 50px 0px 50px;
    clear: both;
    text-align: left;
    }
There I think that's all the bits and pieces you need.

Last edited by Lchad; Mar 28th, 2007 at 13:48. Reason: make it easier to read
Reply With Quote
  #9 (permalink)  
Old Mar 28th, 2007, 14:22
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: IE 5.5 div not centered

Well ... it's hard to say what will help since I don't have IE5.5 installed here but... a few things I see that's wrong with the code above is:

You must add a width (width: 790px to your body { } and your #content width should be 690px since 50+50 = 100.
Reply With Quote
  #10 (permalink)  
Old Mar 29th, 2007, 01:46
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: IE 5.5 div not centered

You might be interested, Karinne: http://tredosoft.com/Multiple_IE

Allows you to have IE 3 through 6. Not that anyone is using 3 or 4, but it's sometimes to look for the hell of it.
Reply With Quote
  #11 (permalink)  
Old Mar 29th, 2007, 04:49
JacobHaug's Avatar
SuperMember

SuperMember
Join Date: Dec 2005
Location: On Internet
Posts: 4,859
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to JacobHaug Send a message via MSN to JacobHaug
Re: IE 5.5 div not centered

Yeah, I can't thank you enough for posting that on here Ryan. I feel like jumping up and down for JOY!!
Reply With Quote
  #12 (permalink)  
Old Mar 29th, 2007, 07:56
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: IE 5.5 div not centered

Hehe, moojoo found it first. I jumped up and down with joy when he gave me that link
Reply With Quote
  #13 (permalink)  
Old Mar 29th, 2007, 12:15
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: IE 5.5 div not centered

Meh ... I don't support IE5.5 or lower. IE6 yes but not lower than that!
Reply With Quote
  #14 (permalink)  
Old Mar 29th, 2007, 12:45
SuperMember

SuperMember
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: IE 5.5 div not centered

I just check my browser stats today and I have .7% of the people using IE 5.5. Not too many!
Reply With Quote
  #15 (permalink)  
Old Mar 29th, 2007, 12:50
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: IE 5.5 div not centered

I have none
Reply With Quote
  #16 (permalink)  
Old Mar 29th, 2007, 13:01
SuperMember

SuperMember
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: IE 5.5 div not centered

lucky you!
Reply With Quote
  #17 (permalink)  
Old Mar 29th, 2007, 13:05
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: IE 5.5 div not centered

Your .7% is probably from a while back too you know. I doubt it's very recent. Depending on how long you've been keeping stats, I doubt you had 5.5 users very recently. I wouldn't worry too much about them or the support of them.

That's my opinion of course
Reply With Quote
  #18 (permalink)  
Old Mar 29th, 2007, 14:01
SuperMember

SuperMember
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: IE 5.5 div not centered

Linda *High 5's* Karinne in complete agreement.... shhhhhhhhh don't tell Ryan!
Reply With Quote
  #19 (permalink)  
Old Mar 29th, 2007, 14:02
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: IE 5.5 div not centered

It will be our little secret
Reply With Quote
Reply

Tags
centered, div, ie 55

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
centered css site in all screen resolutions forry Web Page Design 23 Feb 21st, 2008 10:44
Page does not stay vertically centered in IE using CSS needhelppls Web Page Design 10 Jan 28th, 2008 23:56
BG image centered afowler Web Page Design 3 Oct 16th, 2007 16:34
Need help on keeping everything centered but with a min size ziplock122949 Web Page Design 16 Oct 8th, 2007 01:47
help with 1 centered column t1g3r Web Page Design 3 Mar 14th, 2007 13:26


All times are GMT. The time now is 21:11.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43