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(200, 200, 200);
position: absolute;
background: lightblue;
top: 0;
right: 0;
}
</style>
</head>
<body>
<div id='container'>
<div id='one'></div>
</div>
</body>
</html>
Related examples in the same category