absolute positioning : position absolute : Layout Attributes HTML CSS TUTORIALS


HTML CSS TUTORIALS » Layout Attributes » position absolute »

 

absolute positioning


 

<?xml version="1.0" ?>
<!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" lang="en" xml:lang="en">

<head>
  <title>Absolute Positioning</title>
  <style rel="stylesheet" type="text/css">
div.page {
  position: absolute;
  left: 50px;
  top: 100px;
}

{
  background-color: red;
  width: 200px;
}

p.two {
  position: absolute;
  left: 50px;
  top: -25px;
  background: pink;
}
</style>
</head>

<body>
<div class="page">
<p>b>one</b>This will be at the top of the page.</p>
<p class="two"><b>two</b>This will be in the middle of the page.</p>
<p><b>three</b>This will be at the bottom of the page.</p>
</div>
</body>
</html>

 



HTML code for linking to this page:

Follow Navioo On Twitter

HTML CSS TUTORIALS

 Navioo Layout Attributes
» position absolute