Forum Moderators: not2easy
<div id="wrapper">
<!-- LOTS OF ABSOLUTELY POSITIONED DIVS HERE -->
</div>
<div id="footertext">
<h2>I header here</h2>
<p>Some Text Here</p>
</div>
#wrapper {
height: 804px;
width: 1258px;
margin: auto;
position: relative;
background-image: url(../images/backgrounds/signup.jpg);
background-repeat: no-repeat;
background-position: center top;
clear: both;
}
#footertext {
color: #FFF;
width: 760px;
font-size: 16px;
line-height: 20px;
margin-top: 150px;
margin-right: auto;
margin-bottom: 100px;
margin-left: auto;
position: relative;
height: 150px;
clear: both;
}
However, #footertext is not horizontally centred in relation to #wrapper when the viewport is narrower than the 1258px
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, height=device-height, user-scalable=yes" />
<title>Untitled Document</title>
<style type="text/css">
#div1 {
height: 804px;
width: 1258px;
margin: auto;
position: relative;
clear: both;
background-color:#CCC;
}
#div2 {
background-color:#CFC;
color: #FFF;
width: 760px;
font-size: 16px;
line-height: 20px;
margin-top: 150px;
margin-right: auto;
margin-bottom: 100px;
margin-left: auto;
height: 170px;
clear: both;
border: 1px solid #9F0;
}
</style>
</head>
<body>
<div id="div1">
This should center horizontally
</div>
<div id="div2">
This should also center horizontally
</div>
</body>
</html>