HTML Element Style How to - Position bottom border underneath the bullet of an ordered list








Question

We would like to know how to position bottom border underneath the bullet of an ordered list.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
ol li {<!--from  w  w w  . ja  va  2s.  c om-->
  list-style-type: decimal;
  border-bottom: 1px solid #000;
  padding-left: 20px;
  margin-left: 20px;
}

ol {
  list-style-position: inside;
}
</style>
</head>
<body>
  <ol>
    <li>One</li>
    <li>Two</li>
    <li>Three</li>
  </ol>
</body>
</html>

The code above is rendered as follows: