Click to See Complete Forum and Search --> : Fixed width and centered layout


elAdi
09-20-2005, 02:07 AM
Hi all,

I know some things about CSS, but have never done a CSS layout before. Now, I'm working on a new project and in order to avoid all those complicated table structures, I would like to layout it with CSS. I started to do some reading and had a look at several tutorials, but there is a main problem: most tutorials and references, creat a flexible layout (e.g. resize with browser). Our design however is fixed and centered (see www.aresthetics.ch/websitelayout.jpg) and I simply can't find a tutorial which addresses those issues.

If somebody could post a few tutorials that address this particular issue, that would be great!

Adrian

BonRouge
09-20-2005, 02:48 AM
Here's one (http://bonrouge.com/2c-hf-fixed.php).

Nedals
09-20-2005, 03:18 AM
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<html lang="en">
<head>
<title>untitled</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css">
body {
margin:0px; padding:0px; background:#fff;
}
#content {
margin:0px auto;
width:750px;
height:500px;
border:1px solid #000;
}
</style>
</head>

<body>
<div id="content">
<p>You don't need the height. It will be controlled by your content</p>
<p>The border is there just for demo purposes.</p>
</div>
</body>
</html>