conrad4784
09-17-2009, 07:58 PM
Hello I am trying to build a home page with 4 div's enclosed in a 5th div wrapper. I can never get the content to appear in the middle of the screen. The wrapper DIV is relative possitioned with auto margins and the 4 div's i want inside are absolute positioned. They appear like i want them but not in the center of the browser. I have uploaded a zip file with the code and pictures, any help would be greatly appreciated. thank you
CSS:
#wrapper {background-color:#F00;position:relative; margin:auto;}
#topleft {
position: absolute;
left: 0;
width: 300px;
height: 300px;
background-image:url('images/tools.jpg');
background-repeat:no-repeat;
}
#topright {
position: absolute;
left: 310px;
width: 300px;
height: 300px;
background-image:url('images/techfinger.jpg');
background-repeat:no-repeat;
top: 1px;
}
#bottomleft {
position: absolute;
left: 0;
top: 310px;
width: 300px;
height: 300px;
background-image:url('images/Services.jpg');
background-repeat:no-repeat;
}
#bottomright {
position: absolute;
left: 310px;
top: 310px;
width: 300px;
height: 300px;
background-image:url('images/techfinger_info.jpg');
background-repeat:no-repeat;
}
HTML
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="65001"%>
<!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>
<LINK href="techfinger.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</head>
<body>
<div id="wrapper">
<div id="topleft"></div>
<div id="topright"></div>
<div id="bottomleft"></div>
<div id="bottomright"></div>
</div>
</body>
</html>
Any help would be great i just need to center the content thank you.
CSS:
#wrapper {background-color:#F00;position:relative; margin:auto;}
#topleft {
position: absolute;
left: 0;
width: 300px;
height: 300px;
background-image:url('images/tools.jpg');
background-repeat:no-repeat;
}
#topright {
position: absolute;
left: 310px;
width: 300px;
height: 300px;
background-image:url('images/techfinger.jpg');
background-repeat:no-repeat;
top: 1px;
}
#bottomleft {
position: absolute;
left: 0;
top: 310px;
width: 300px;
height: 300px;
background-image:url('images/Services.jpg');
background-repeat:no-repeat;
}
#bottomright {
position: absolute;
left: 310px;
top: 310px;
width: 300px;
height: 300px;
background-image:url('images/techfinger_info.jpg');
background-repeat:no-repeat;
}
HTML
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="65001"%>
<!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>
<LINK href="techfinger.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</head>
<body>
<div id="wrapper">
<div id="topleft"></div>
<div id="topright"></div>
<div id="bottomleft"></div>
<div id="bottomright"></div>
</div>
</body>
</html>
Any help would be great i just need to center the content thank you.