hi
i'm trying to centre my website, it's only 800px wide...so it fits on any monitor settin but the thing is on monitors with a higher res (like mine...i run my machine on 1280 x 1024) the site is all on the left side and the rest of the screen is just filled with a bg image (in my case solid black)
...what i'm trying 2 ask...how do i create margins so that my 'site' is always in the middle of the screen
some poeple told my i should add this code:
body {
width : 800px;
margin-left : auto;
margin-right : auto;
}
...but that piece of code changes nothing at all
please help
centering my website
centering my website
[ url=http://gothboi.comicgenesis.com/ ][ img]http://gothboi.comicgenesis.com/signatu ... nature.gif[/img ][/url ]
http://gothboi.comicgenesis.com/ ----daily gothic humour
http://gothboi.comicgenesis.com/ ----daily gothic humour
- Black Sparrow
- Cartoon Anti-Hero
- Posts: 6973
- Joined: Fri Jul 22, 2005 9:04 am
- Location: Violating your restraining order
- Contact:
Where are you adding that code? It should probably go in your <body> tag, as such:
---Churusaa
Code: Select all
<body {
width : 800px;
margin-left : auto;
margin-right : auto;
} >YOURPAGE</body>
- Rkolter
- Destroyer of Words (Moderator)
- Posts: 16399
- Joined: Tue Jun 24, 2003 4:34 am
- Location: It's equally probable that I'm everywhere.
- Contact:
That'd actually end up centering EVERYTHING. Text, title images, image bars, the comic, tables, etcetera. At least, I'm pretty sure that is what it would do.
If you like the layout of your page, but just want your page itself (in that layout) centered, you can put your whole page within a table, then center the table. Someone will probably hit me with a stick for doing that because I'm sure it's not up to standard for code, but it would work.
If you like the layout of your page, but just want your page itself (in that layout) centered, you can put your whole page within a table, then center the table. Someone will probably hit me with a stick for doing that because I'm sure it's not up to standard for code, but it would work.
Code: Select all
--- header, line for body, div, etcetera ---
<center>
<table width=800 border=0>
<td width=100% border=0>
--- entire comic and website portion ---
</td>
</table>
</center>
thanx...it's all fixed now. i just added <centre> </centre> to the body...damn that was easy
[ url=http://gothboi.comicgenesis.com/ ][ img]http://gothboi.comicgenesis.com/signatu ... nature.gif[/img ][/url ]
http://gothboi.comicgenesis.com/ ----daily gothic humour
http://gothboi.comicgenesis.com/ ----daily gothic humour
Um....
I guess now would be a bad time to tell you it's not centering in Firefox 1.07, wouldn't it?
---Churusaa
---Churusaa