6 replies [Last post]
thatboyjim
thatboyjim's picture
Offline
Regular
Last seen: 13 years 29 weeks ago
Joined: 2007-01-25
Posts: 41
Points: 0

Hi guys

Anyone know how to center align a div in i.e. 5 and below...

I currently use...

#wrapper {
width:780px;
margin:0 auto;
}

This works in I.E. 6 upwards and all other modern browsers but not below v6.

Thanks in advance.

eddy
eddy's picture
Offline
Enthusiast
Last seen: 10 years 33 weeks ago
Timezone: GMT+2
Joined: 2006-01-27
Posts: 59
Points: 0

body{ 

body{ text-align:center; }

#wrapper{
text-align:left;
margin:0 auto;
width:780px;
}

IE thinks that div's are inline elements.

Anyone who hates kids can't be all bad.
W.C. Fields

thatboyjim
thatboyjim's picture
Offline
Regular
Last seen: 13 years 29 weeks ago
Joined: 2007-01-25
Posts: 41
Points: 0

Cheers, that works... means

Cheers, that works... means I have to set everything else to text-align:left though. Sad

eddy
eddy's picture
Offline
Enthusiast
Last seen: 10 years 33 weeks ago
Timezone: GMT+2
Joined: 2006-01-27
Posts: 59
Points: 0

no you dont have to, only

no you dont have to, only the elements wich are not in your wrapper div

Anyone who hates kids can't be all bad.
W.C. Fields

thatboyjim
thatboyjim's picture
Offline
Regular
Last seen: 13 years 29 weeks ago
Joined: 2007-01-25
Posts: 41
Points: 0

Everything in this case.

Everything in this case. Sad Tongue

eddy
eddy's picture
Offline
Enthusiast
Last seen: 10 years 33 weeks ago
Timezone: GMT+2
Joined: 2006-01-27
Posts: 59
Points: 0

as i see it, everything is

as i see it, everything is in your wrapper, so you only need to set text-align:left in your wrapper.

Anyone who hates kids can't be all bad.
W.C. Fields

thatboyjim
thatboyjim's picture
Offline
Regular
Last seen: 13 years 29 weeks ago
Joined: 2007-01-25
Posts: 41
Points: 0

Ah sorry, I'm with you

Ah sorry, I'm with you now... damn this flu is messing my head.

Thanks for your help.