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.


 Subscribe in a reader

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

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Mar 27th, 2007, 21:33
Elite Veteran
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!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Mar 27th, 2007, 21:41
Elite Veteran
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;
    }
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Mar 27th, 2007, 21:50
Elite Veteran
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Mar 27th, 2007, 22:44
Ryan Fait's Avatar
Elite Veteran
Join Date: May 2006
Location: Las Vegas
Posts: 3,787
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Mar 28th, 2007, 12:03
Elite Veteran
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Mar 28th, 2007, 12:59
Elite Veteran
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?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Mar 28th, 2007, 13:14
Elite Veteran
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?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old Mar 28th, 2007, 13:48
Elite Veteran
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9  
Old Mar 28th, 2007, 14:22
Elite Veteran
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10  
Old Mar 29th, 2007, 01:46
Ryan Fait's Avatar
Elite Veteran
Join Date: May 2006
Location: Las Vegas
Posts: 3,787
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #11  
Old Mar 29th, 2007, 04:49
Elite Veteran
Join Date: Dec 2005
Location: On Internet
Posts: 4,859
Thanks: 0
Thanked 0 Times in 0 Posts
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!!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #12  
Old Mar 29th, 2007, 07:56
Ryan Fait's Avatar
Elite Veteran
Join Date: May 2006
Location: Las Vegas
Posts: 3,787
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #13  
Old Mar 29th, 2007, 12:15
Elite Veteran
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!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #14  
Old Mar 29th, 2007, 12:45
Elite Veteran
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!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #15  
Old Mar 29th, 2007, 12:50
Elite Veteran
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #16  
Old Mar 29th, 2007, 13:01
Elite Veteran
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!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #17  
Old Mar 29th, 2007, 13:05
Elite Veteran
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #18  
Old Mar 29th, 2007, 14:01
Elite Veteran
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!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #19  
Old Mar 29th, 2007, 14:02
Elite Veteran
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
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