Horiontal menu by simple css

When we need a new menu we mostly depend on designers while you can create horzontal menu easily by writing some simple css, let's see how easy it is

        list-style-type: none;
        margin: 0;
        padding: 0;
        overflow: hidden;
   ul.menu li
        float: left;
   ul.menu a:link, ul.menu a:visited
        display: block;
        background-color: #009900;
        padding:5px 15px;
   ul.menu a:hover{color:#FBF8F4;}

This is only the css to create a horizontal meny with mouse over effect.

And here is the html for the menu

<ul class="menu">
    <li><a href="#">Home</a></li>
    <li><a href="#">Product</a></li>        
    <li><a href="#">Services</a></li>
    <li><a href="#">Contact</a></li>
    <li><a href="#">About</a></li>

To check how it looks likes copy style and html and put into the folowing indicated place

<!DOCTYPE html>
    Copy and paste style here
    Copy and paste html here

and save the file with html extension and open it in browser and check the mouseover effect.

  • html
  • css
By Flower On 31 Dec, 12  Viewed: 343

Other blogs you may like

MVC HTML Paging Helper with search and sort

MVC Search Sort and Paging is common feature we need to use, so let's write the HTML Paging Helper for our project, which will work faster than anyother build-in costum grid system because they contain many other features we don't need for our application and don't support many features we want. In... By Ali Adravi   On 07 May 2018  Viewed: 528

3 Excellent HTML5 Boilerplates for Quick Development

If you have just started out with HTML5, then boilerplates help you reason out with the framework and help create a professional front end and a robust website. This open source project was created in order to make you HTML5 ready, in case you have just started out. You can directly download and... By Deepa Ranganathan   On 01 Jun 2015  Viewed: 224

Use XSLT to create menu from database

In some situations we need to create website menu from database, say our application have ability to create pages so that must also need to have a menu item to go to that page. So how to create menu with all those nice CSS and other settings, I think XSLT is best to use in these... By Hamden   On 16 Mar 2013  Viewed: 1,023

HTML5 video and browser compatibility

**HTML5 video and browser compatibility** Now to use video on browser is quite easy, we don't want any flash player any more, simply we can use `<vidoe>` tag and set the video path with src and done. Video tag attributes: - autoplay : "autoplay" or "" (empty string) [Instructs the UA to... By Myghty   On 30 Dec 2012  Viewed: 1,183

Social media sharing buttons without javascript

Social Media Sharing Buttons Without JavaScript I was looking for code to add social media buttons to share my blog on different sites like facebook, twitter, google plus, tumbler and email, I search many websites but could not found any good article which can help to add these buttons without... By Hamden   On 29 Dec 2014  Viewed: 1,957