padding-left: ***;

Browser
  • IE
  • Cr
  • Sf
  • Fx
  • O

The padding-left property sets the left padding of an element.

When you apply this property to the LI element, the spacing between marker and text can be adjusted.


li {
padding-left: 20px;
}

Property Value Explanation
padding-left length, %, or auto the left padding

Example


<html>
<head>
<title>TAG index</title>

<style type="text/css">

#example li {
padding-left: 30px;
}

</style>

</head>
<body>

<ul>
<li>First list item</li>
<li>Second list item</li>
<li>Third list item</li>
</ul>

<ul id="example">
<li>First list item</li>
<li>Second list item</li>
<li>Third list item</li>
</ul>

</body>
</html>

Output
  • First list item
  • Second list item
  • Third list item
  • First list item
  • Second list item
  • Third list item