HTML Element Style How to - Separate list item with bottom border








Question

We would like to know how to separate list item with bottom border.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
.menuoptions {<!--from  w ww.  ja v  a2s . c  om-->
  position: relative;
  height: 30px;
  width: 225px;
  color: #666;
  line-height: 40px;
  font-weight: bold;
  margin-top: -10px;
  top: 10px;
  list-style: none;
  padding: 0;
}

.menuoptions li {
  border-bottom: solid 1px #ccc;
  padding-left: 10px;
}
</style>
</head>
<body>
  <ul class="menuoptions">
    <li>Home</li>
    <li>Contact</li>
    <li>About</li>
    <li>Product</li>
    <li>Help</li>
  </ul>
</body>
</html>

The code above is rendered as follows: