The creation of a simple static navigation menu for Web pages

Source: Internet
Author: User

The creation of Web page navigation menu

Recently beginner Html/css, today learned a simple static navigation bar of the production. A very simple, very basic thing.
Idea: navigation menu –> Book directory, entry structure –> with no list to build the navigation menu

1. First build the UL in the HTML code:

    <ul>        <li><a href="#">首&nbsp;页</a></li>        <li><a href="#">新闻快讯</a></li>        <li><a href="#">产品展示</a></li>        <li><a href="#">售后服务</a></li>        <li><a href="#">联系我们</a></li>    </ul>


The effect is as follows (the display in the browser is underlined and we remove it in the second step):


    • Home
    • News Flash
    • Product Show
    • After - sales service
    • Contact Us


2. This is where we have the basic directory, we create CSS files, introduced to HTML, and then do the style cleanup, both the original style erased, and build a new style:
    • Basic style cleanup: *{margin:0;padding:0}

    • Unordered list dot removal: Li{list-style-type:none;}

    • Underline removal: A{text-decoration:none}

At the same time, some CSS customizations are made on this basis.

    • A:hvoer is a CSS pseudo-class that is used when moving the mouse to a style
      Final CSS code:
   *{margin: 0;padding: 0;font-size: 20px};   ul{width:100px}li{list-style-type: none;}   a{text-decoration:none;display:block;height: 30px;line-height: 30px;width: 100px;background-color: #ccc;margin-bottom: 1px;text-indent: 10px}   a:hover{background-color: #f60;color: #fff};

You need to set the a tag as a block element to set the aspect, hover effect code:A{display:block}

Text indent label Text-indent does not affect the overall width

3. Effects

The creation of a simple static navigation menu for Web pages

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.