centered content area

Status
Not open for further replies.

Daiphron

New Member
Messages
25
Reaction score
0
Points
0
Hi,

I am trying to create a centered content area with CSS on my site. Pretty much just like this forum, actually. Could anyone explain how to do it? All I really want for now is an area in the center of the screen where all my content will go so the explanation need only be how to set up the bare minimum. Right now I have a div element of w800 x h1000 pixels and my approach ist to center that element and then place the content in it (or rather "on top of ot"). So I guess it boils down to these two questions: Is that a smart approach at all? If it is, how do center the element? I have tried to modify the margins and background-position but I can't figure out how to get it dead center regardless of screen size.

Thanks
 

Penguin129

New Member
Messages
68
Reaction score
0
Points
0
html
Code:
<div class="content">
  blah blah some stuff here
</div>
css
Code:
div.content {
  height: 1000px;
  margin-left: auto;
  margin-right: auto;
  width: 800px;
}

That should do.
 
Status
Not open for further replies.
Top