Move right and left with margin : Box Layout : Box Model HTML CSS TUTORIALS


HTML CSS TUTORIALS » Box Model » Box Layout »

 

Move right and left 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;
}

</style>
</head>
<body>
<div> 
    <span class="moved-left">Moved-left </span> 
    <span class="moved-right">Moved-right </span> 
    <span class="push-right">Push-right</span> 
    <span class="pull-left">Pull-left</span> 
    <em>None</em> 
</div> 
</body>
</html>

 



HTML code for linking to this page:

Follow Navioo On Twitter

HTML CSS TUTORIALS

 Navioo Box Model
» Box Layout