Page Widget How to - Use thick border bottom to indicate current menu and hover








Question

We would like to know how to use thick border bottom to indicate current menu and hover.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
#underlinemenu {<!--from   w  ww  .j  av  a 2  s  . c  o m-->
  padding: 0;
  margin: 0;
  padding-bottom: 30px;
}

#underlinemenu ul {
  float: left;
  width: 770px;
  height: 57px;
  background-color: #EEE;
  margin: -1px 0 -30px 0;
}

#underlinemenu ul li {
  display: inline;
  float: left;
  color: black;
  padding: 0;
  margin: 0 2px;
}

.current_page_item a {
  color: blue;
  border-bottom: 5px solid blue;
}

#underlinemenu ul li a {
  color: black;
  text-decoration: none;
  padding: 21px 10px 14px 5px;
  display: block;
}

#underlinemenu ul li a:hover {
  color: red;
  border-bottom: 5px solid red;
}
</style>
</head>
<body>
  <div class="wpbook_header">
    <div id="underlinemenu" class="clearfix">
      <ul>
        <li class="current_page_item"><a href="#">Home</a></li>
        <li><a href="#">Blogs</a></li>
        <li><a href="#">Company</a></li>
        <li><a href="#">Gallery</a></li>
        <li><a href="#">FAQs</a></li>
        <li><a href="#">Competition</a></li>
      </ul>
    </div>
  </div>
</body>
</html>

The code above is rendered as follows: