Static postioned container and absolute child to the top and right : Box Layout : Box Model HTML CSS TUTORIALS


HTML CSS TUTORIALS » Box Model » Box Layout »

 

Static postioned container and absolute child to the top and right


 


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en'>
    <head>
        <title>positioning</title>
        <style rel='stylesheet' type='text/css'>
body {
    background: lightyellow;
}
div#container {
    position: static;
    width: 300px;
    height: 300px;
    margin: auto;
}
div#one {
    width: 100px;
    height: 100px;
    border: 1px solid rgb(200200200);
    position: absolute;
    background: lightblue;
    top: 0;
    right: 0;
}
        </style>
    </head>
    <body>
        <div id='container'>
            <div id='one'></div>
        </div>
    </body>
</html>

 



HTML code for linking to this page:

Follow Navioo On Twitter

HTML CSS TUTORIALS

 Navioo Box Model
» Box Layout