View Full Version : Is it possible to make my layout centered? (With the CSS code)? Click here for the


dudepet39
12-29-2004, 09:56 PM
Is it possible to center this stuff?

<img src=http://img90.exs.cx/img90/1563/topimage0uw.gif>

<style>
body {
margin: 0;
background-color: #FFFFFF;
background-image: url(http://img90.exs.cx/img90/8547/toptobottom0lt.gif);
background-repeat: repeat-y;
background-attachment: fixed;
}
</style>

http://www.freewebs.com/neographicsmaker/testcoding.html

Is it possible to center that layout in the middle of the page? Thanks.

MaGiCSuN
12-29-2004, 10:30 PM
it's possible, but with css i doubt it although i'm not completely sure. Here's how i fixed it:


<html>
<head>
<style type="text/css">
body {
margin: 0;
background-color: #FFFFFF;
background-image: url(http://img90.exs.cx/img90/8547/toptobottom0lt.gif);
background-repeat: repeat-y;
background-attachment: fixed;
background-position: top center;
}
</style>
</head>

<body>
<center>
<table border="0" cellspacing="0" cellpadding="0" width="751" background="http://img90.exs.cx/img90/1563/topimage0uw.gif" style="background-repeat: no-repeat;">
<tr><td height="400" colspan="5">&nbsp;</td></tr>
<tr><td width="25">&nbsp;</td>
<td valign="top" width="380">content here</td>
<td width="25">&nbsp;</td>
<td valign="top" width="296"><IFRAME width='190' height='520' src='http://quickshout.com/shoutbox.php?naam=dudepet39' frameborder=0></IFRAME></td>
<td width="25">&nbsp;</td></tr></table>
</center>
</body>
</html>

i also made your page a proper page with <html> tags etc :) if someone else knows a better way with css then i'm sure they'll post it :)

Love,
Mirna

dudepet39
12-29-2004, 10:37 PM
Ok, sorry, I ALWAYS forget to put the <head> tags in! I will see if this works..

dudepet39
12-29-2004, 10:45 PM
It worked it worked!!!! Thank you very much!! *hugs you*.

dudepet39
12-29-2004, 11:08 PM
Is it possible to put most of that in an external style sheet so I dont have all that code?

MaGiCSuN
12-29-2004, 11:20 PM
put this in a .css file:

body {
margin: 0;
background-color: #FFFFFF;
background-image: url(http://img90.exs.cx/img90/8547/toptobottom0lt.gif);
background-repeat: repeat-y;
background-attachment: fixed;
background-position: top center;
}

then replace your <style>cssbitshere</style> part with this:

<link rel="stylesheet" href="style.css" type="text/css">

offcourse change style.css to the name of your .css file :)

love,
Mirna