padding-left: 1.5em; : padding left « CSS « HTML / CSS

HTML / CSS » CSS » padding left 
padding-left: 1.5em;
  
<!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" lang="en-US">
  <head>
    <title>Chapter 2</title>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <style>
h1 {
  font: 1.6em Verdana, Geneva, Arial, Helvetica, sans-serif;
  padding: 0.2em;
}
{
  font: 1em Verdana, Geneva, Arial, Helvetica, sans-serif;
}
.indent {
  padding-left: 1.5em;
}
</style>    
  </head>
  <body>
    <h1>Heading</h1>
    <p class="indent">This is a test.</p>
  </body>
</html>

   
    
  
Related examples in the same category
1.'padding-left' Example
2.padding-left: 0px
3.padding-left: 8px;
4.padding-left: 1cm; padding-right: .5cm;
5.Independently set padding-left, padding-right, padding-top, and padding-bottom.
6.The element's background is displayed in the padding area.
7.padding:0 is the default.
8.Combine negative text-indent and padding-left
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.