<html>
<head>
<title>Div example</title>
</head>
<body>
<style type="text/css">
.left1 {
float: left;
position:absolute;
width: 120px;
height: 15px;
padding: 10px;
border: 1px solid;
left: 50%;
margin-left: -60px;
top: 0px;
}
.left2 {
float: left;
position:absolute;
width: 120px;
height: 15px;
padding: 10px;
border: 1px solid;
left: 50%;
margin-left: -60px;
top: 40px;
}
/* "html>body" is a childselector command which means:
select any body element that is a child of a html element.
IE does not understand the childselector and will skip this rule.
This is needed for Firefox.
*/
html>body .left2 {
top: 37px;
}
</style>
<div class="left1">
1
</div>
<div class="left2">
2
</div>
</body>
</html>