How to Make Dropdown Menu in HTML.


How to Make Dropdown Menu in HTML  


CSS:

      ul a
  {
  color:white;
  text-decoration:none;
  display:block;
  }
  
  
  li, .dbutton{
   
   width:100px;
   display:inline-block;
   height:25px;
   line-height:25px;
   text-align:center;
   
   background-color:black;
  
   }
  
  ul a:hover
  {
  background-color:orange;
  color:black;
  }
  .dropdown
  {
  display:inline-block;
  }
  .dmenu
  {
  display:none;
  position:absolute;
  background-color:red;
  width:100px;
  }
  .dmenu a
  {
  color:black;
  display:block;
  text-decoration:none;
  }
  .dmenu a:hover
  {background-color:pink;
  height:25px;
  }
  
  .dropdown:hover  .dmenu{
  display:block;}

------------------------------------------------------------------------------------------------------------------------


HTML:

<ul>
   <li ><a  href="#">Softwares</a></li> 
   <li ><a  href="#">Books</a></li>  
   <li ><a  href="#">Tricks</a></li> 
   <li  class="dropdown"><a  class="dbutton" href="#">Programming</a>
   <div class="dmenu">
   <a href="#">HTML</a>
   <a href="#">C++</a>
   <a href="#">Java</a>
   </div>
   </li> 
</ul>

----------------------------------------------------------------------------------------------------------------------

Combine Both in HTML page.... 

Share To:

Adeel Rasheed

Full Stack Website Developer

Post A Comment:

0 comments so far,add yours