Topic: Central alignment on screen (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=21786" title="Pages that link to Topic: Central alignment on screen (Page 1 of 1)" rel="nofollow" >Topic: Central alignment on screen <span class="small">(Page 1 of 1)</span>\

 
templar654
Bipolar (III) Inmate

From: Aiur, the Tarsonian Galaxy
Insane since: Apr 2004

posted posted 05-13-2004 14:11

I've been trying to central align my site using CSS. I want the main container div to be central aligned on the screen. So far I couldn't get it done. If I use margin then it just sits there. Can anyone tell me how to do this properly??


Online Portfolio

Blaise
Nervous Wreck (II) Inmate

From:
Insane since: Jun 2003

posted posted 05-13-2004 14:53

I'm pretty sure there are some issues with cross-browser compatability with this.

IE doesn't understand margin: auto; properly and Moz won't text-align: center; a div, so you'll need to use both.

Not sure of the exact syntax, but it's something like this (I think)

code:
body{
text-align-center;
}

#container{
width: 700px;
text-align: left;
margin-left: auto;
margin-right: auto;
}

Hope that helps!

Cheers,

Blaise

(Edited by Blaise on 05-13-2004 14:54)

templar654
Bipolar (III) Inmate

From: Aiur, the Tarsonian Galaxy
Insane since: Apr 2004

posted posted 05-14-2004 09:06

Yo thanks man that did it.


Online Portfolio



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu