Using padding to control the list item indent : li padding « Tags « HTML / CSS






Using padding to control the list item indent

    


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  <title></title>
  <style type="text/css">
    ul {
      list-style-type: square;
      list-style-position: outside;
      width: 33em;
      padding: 0.5em;
      border: 1px solid black;
      margin: 0.75em 0 0 1.5em;
    }
    ul.one {
      padding-left: 0;
    }
    ul.two {
      padding-left: 1em;
    }
    ul.three {
      padding-left: 1.5em;
    }
    li {
      padding: 0;
      margin: 0;
      border: 1px dashed black;
    }
  </style>
</head>
<body>
  <ul class="one">
    <li>Li Europan lingues es membres del sam familie.</li>
  </ul>
  <ul class="two">
    <li>Li Europan lingues es membres del sam familie.</li>
  </ul>
  <ul class="three">
    <li>Li Europan lingues es membres del sam familie.</li>
  </ul>
</body>
</html>

   
    
    
  








Related examples in the same category

1.LI padding: .3em 0
2.li padding: .3em 0 1em 40px;
3.ol, ul {margin-left: 0; padding-left: 2.5em;}