I'm trying to center a <div> element in my webpage but can't seem to get it right.
Here's the basic structure:
<div id="contentwrapper"> <div id="maincontent"> </div> </div>
So that part I want to center is the "maincontent" which contains the writing.
Here's the css for both above:
#contentwrapper{
width:900px;
height: 450px;
background-image: url(images/Front_1.jpg);
background-repeat: no-repeat;
}
#maincontent {
position:absolute;
width: 380px;
text-align: justify;
border-style: solid;
margin-top: 10px;
margin-bottom: 10px;
height: 410px;
background-color: #000;
background-repeat: no-repeat;
-moz-border-radius: 8px;
-webkit-border-radius: 8px;
}I've tried using left/right margin set to Auto but with no success. I've also tried using the Left/right properties but you can only use pixels and percentages which still doesn't do it.
Am I being stupid here? How do I go about getting the "maincontent" centered?
Thanks
Nick
Help


















