17 replies [Last post]
cgustin
Offline
Regular
Last seen: 17 years 16 weeks ago
Joined: 2005-12-06
Posts: 29
Points: 0

Alright anyone who can figure this out is a smart smart person Wink I have a page that I have simply done like this:
body{
font-family: blah;
margin: 0;
padding: 0;
font-sixe: blah;
background-color: #fff;
}

#container {
width:749px;
background-image: url( blah.jpg);
MARGIN: AUTO;
margin-top: 10px;
}

This works perfect in everything but IE 5.5. on a pc...can anyone tell me why this is happening? If someone wants my full code, by all means I would send it your way. I would appreciate anything anyone could think of.

Tyssen
Tyssen's picture
Offline
Moderator
Brisbane
Last seen: 8 years 23 weeks ago
Brisbane
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8201
Points: 1386

Page not centered in IE 5.5

You need text-align: center for IE5+. You'll need to reset your text-align to left again for descendant elements.

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference

capt.mahou
Offline
Regular
Last seen: 17 years 16 weeks ago
Joined: 2005-12-07
Posts: 12
Points: 0

Page not centered in IE 5.5

Exactly, remember it must be in <body> tag

cgustin
Offline
Regular
Last seen: 17 years 16 weeks ago
Joined: 2005-12-06
Posts: 29
Points: 0

Page not centered in IE 5.5

Tried it, it does nothing. If I don't align it to the left, all fonts are centered so I know it is doing something, but the whole page is still to the left, I add the left command, and my fonts are back to normal but still, the page is not centered Sad

Any other suggestions?

Anonymous
Anonymous's picture
Guru

Page not centered in IE 5.5

cgustin wrote:
Any other suggestions?
Yeah, post a link.

cgustin
Offline
Regular
Last seen: 17 years 16 weeks ago
Joined: 2005-12-06
Posts: 29
Points: 0

Page not centered in IE 5.5

http://www.arrowheadcreative.com/corp/java.htm

2 issues with IE 5.5 on this one, not centered and I don't know a straight hack for the navigation div to have a different magrin-left....

Thanks much!

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 8 years 11 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Page not centered in IE 5.5

The first thing I would have done is to check my markup for errors!

Try loosing the extra closing div after #container and then try text-align:center on the body rules and text-align:left on the #container I've not known this not to work.

You need to add display:inline to the #navigation for the left margin and it looks as though you are having a whitespace issue with the list elements/anchors and their vertical spacing in IE6 you will need to put the anchors into HasLayout mode with height/width

Hugo.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

cgustin
Offline
Regular
Last seen: 17 years 16 weeks ago
Joined: 2005-12-06
Posts: 29
Points: 0

Page not centered in IE 5.5

alright so I tried a few things...when I add text-align: center IE 5.5 doesn't even see this, but 6.X does...so it isn't seeing anything on it. I took out the last closing div after the nav, nothing. I need that last div though. I did it like that because the drop shadow needs to fade at the bottom and if I keep that div in the container div, it won't work because I have a background on that div.

I did the display: inline, messes it up even worse. Gives me bullets in 5.5 which I don't know why because I have list-style-type: none.

So back to the drawing board...any other suggestions?

Oh and sorry I had changed the doctype and forgot to change it back...it validates the css now.

cgustin
Offline
Regular
Last seen: 17 years 16 weeks ago
Joined: 2005-12-06
Posts: 29
Points: 0

Page not centered in IE 5.5

I added height to the navigation "li" which duh, don't know why I didn't do that, but when I do that, I get the height I want, of course, but now my text isn't fitting, therefore causing it to drop to two lines of text. Look at it in Win IE and then FF..

http://www.arrowheadcreative.com/corp/java2.htm

*Added* Also when you click on the nav to the left, on IE huge space, FF and mac has it correct...suggestions?

I feel like I am just making this worse and worse the more I mess with it.... Sad

Still have 2 problems remaining...I'm at a loss!

Anonymous
Anonymous's picture
Guru

Page not centered in IE 5.5

cgustin wrote:
I feel like I am just making this worse and worse the more I mess with it.... Sad
That, my friend, is when it is time to hire someone. Smile

cgustin
Offline
Regular
Last seen: 17 years 16 weeks ago
Joined: 2005-12-06
Posts: 29
Points: 0

Page not centered in IE 5.5

I am the hired person...

cgustin
Offline
Regular
Last seen: 17 years 16 weeks ago
Joined: 2005-12-06
Posts: 29
Points: 0

Page not centered in IE 5.5

Alright so I took away all the code but the body...and the page isn't even centered there so the problem is right away in the code...can anyone see why????????????

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 8 years 11 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Page not centered in IE 5.5

Quote:
I am the hired person...
Smile

I don't know what to say really I can get the page centred in IE5.5 with no problem .

There is some other problem your end I'm afraid as for that navigation I think you are going to need to work through those rules carefully working out whether all that hacking is really needed when you float an element and apply a margin in the same direction then IE will double that margin if that float is at the extreme side of an element, at a glance I don't know why the fix for it (display:inline ) is having that effect in 5.5 .

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

cgustin
Offline
Regular
Last seen: 17 years 16 weeks ago
Joined: 2005-12-06
Posts: 29
Points: 0

Page not centered in IE 5.5

Well send me your exact code then please, I just checked it out on someone elses machine and it doens't center. dunno what's going on. Check out the same link as above (java2.htm) and see if the page is still off to the left but the text is centered??

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 8 years 11 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Page not centered in IE 5.5

It's that horrible and outmoded voice hack; move your text-align above the voice hack in the body tag (to the top of the rules) and you will need a text-align:left on the first child element (container)

Hugo.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

cgustin
Offline
Regular
Last seen: 17 years 16 weeks ago
Joined: 2005-12-06
Posts: 29
Points: 0

Page not centered in IE 5.5

YES!!!!!!!!!!!!!!!!!!!!!!!!!

How much do I love you right now?!?!?!?!?!?!?

Alright one more small question for you. if you check it out in 5.5 on the PC, you will notice that the navigation on some lines are taking up 2 lines and not in any other browser, I have messed with width of the navigation, which seems to work, but than breaks it in all other browsers...suggestions?? Also since I have messed with it, when you break out the navigation on IE, it has a large spacing issue on top and bottom of 1st and last links...but not on FF (or anything on the mac), what have I done...I compared my old css with this and really can't see anything that changes it back.

New link that is centered:
http:

Main issue solved, thank you SO much!!

cgustin
Offline
Regular
Last seen: 17 years 16 weeks ago
Joined: 2005-12-06
Posts: 29
Points: 0

Page not centered in IE 5.5

Anyone, anyone????

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 8 years 11 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Page not centered in IE 5.5

I'm really not sure how you're getting in such a pickle with this layout it's really a very straightforward one I would go back to the start and work your way through the main layout containers rethink your margins (I don't get the left 11px margin) auto center your banner, actually it may be easiest to add a inner container that will hold your content to the inside edge of your page width/graphic, most of all watch for any padding borders on your main containers with fixed widths as this will cause problems in IE5.5 try and keep any padding to inner elements such as paragraphs.

The link problems will fall into one of a few categories either whitespace issues which can be fixed by ensuring that anchors or li have dimensions to force HasLayout or padding/margins so reduce everything down to basics and work your way through the rules adding back in the rules as you require them.

I haven't time to look at this in IE5.5 now but if I get the chance I'll have a look in the morning.

Hugo.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me