Indent up and down with margin : Box Layout : Box Model HTML CSS TUTORIALS


HTML CSS TUTORIALS » Box Model » Box Layout »

 

Indent up and down with margin


 

<!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></title>
    <style type="text/css" media="Screen">
* .moved-left {
  margin-left: -26px;
  background: red;
}

* .push-right {
  margin-right: 50px;
    background: gold;
}

* .moved-right {
  margin-left: 50px;
  background: yellow;
}

* .pull-left {
  margin-right: -20px;
  background: blue;
  color: white;
}

* .moved-down {
  margin-top: 20px;
  background: red;
}

* .push-down {
  margin-bottom: 20px;
  background: gary;
}

* .moved-up {
  margin-top: -13px;
  background: yellow;
  
}

* .pull-up {
  margin-bottom: -16px;
    background: pink;
}
</style>
</head>
<body>
<div> 
    <div class="moved-down center">Moved-down Static Block </div> 
    <div class="moved-up center">Moved-up Static Block</div> 
    <div class="push-down center">Push-down Static Block</div> 
    <div class="pull-up center">Pull-up Static Block</div> 
    <div class="center">None</div> 
</div> 
</body>
</html>

 



HTML code for linking to this page:

Follow Navioo On Twitter

HTML CSS TUTORIALS

 Navioo Box Model
» Box Layout