Wednesday, September 28, 2011

Fixed and Absolute Boxes



Below is my code:

<!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" />
<title>New Boxes</title>
<style type="text/css">
.bigBox {
background-color: #330;
height: 600px;
width: 600px;
position: fixed;
left: 50px;
top: 50px;
}
.mediumBox {
background-color: #069;
height: 400px;
width: 400px;
position: fixed;
left: 150px;
top: 150px;
}
.bigBoxAbsolute {
height: 600px;
width: 600px;
position: absolute;
left: 50px;
top: 750px;
background-color: #300;
}
.smallBoxAbsolute {
background-color: #069;
height: 200px;
width: 200px;
position: absolute;
margin: 100px;
}
.smallBox {
background-color: #0F0;
height: 200px;
width: 200px;
position: fixed;
left: 250px;
top: 250px;
}
.mediumBoxAbsolute {
background-color: #930;
height: 400px;
width: 400px;
position: absolute;
margin: 100px;
}
</style>
</head>

<body>
<div class="bigBox"></div>
<!--fixed big box class-->
<div class="mediumBox"></div>
<!--fixed medium box class-->
<div class="smallBox"></div>
<!--fixed small box class-->

<div class="bigBoxAbsolute">
<!--absolute big box class-->
<div class="mediumBoxAbsolute">
        <!--absolute medium box class - nested within big box-->
<div class="smallBoxAbsolute"></div>
                <!--absolute small box class - nested within medium box-->
</div>
</div>
</body>
</html>

2 comments:

  1. GREAT JOB, NOW YOU ARE STARTING TO GET IT AND THE NEXT MOVE IS ONE BIG COLOR WEBSITE.
    ANGELA

    ReplyDelete