How can I use CSS to create a vertical navigation menu?

Source: Internet
Author: User

After the Web standards are applied to create webpages, we usually use ul unordered list tags to build menus. We have discussed many horizontal menus before. In the previous article, we described how to create Korean menus with ul + li and css. is a vertical navigation menu. Today we are looking at another vertical navigation menu. We are constantly summing up experience and improving the coding level, so that we can be more comfortable in actual operations.
Let's look at the following XHTML code:

The code is as follows: Copy code
<Ul> <span> www.111cn.net </span>
<Li> <a href = "http://www.111cn.net" target = "_ blank"> Div + CSS tutorial </a> </li>
<Li> <a href = "http://www.111cn.net" target = "_ blank"> CSS layout instance </a> </li>
<Li> <a href = "http://www.111cn.net" target = "_ blank"> CSS online manual </a> </li>
</Ul>
<Ul> <span> www.111cn.net </span>
<Li> <a href = "http://www.111cn.net" target = "_ blank"> Div + CSS tutorial </a> </li>
<Li> <a href = "http://www.111cn.net" target = "_ blank"> CSS layout instance </a> </li>
<Li> <a href = "http://www.111cn.net" target = "_ blank"> CSS online manual </a> </li>
</Ul>

There are two unordered lists. Each list contains three items, that is, the content of the navigation menu.
We use CSS to define the style so that it can be displayed as required. Let's look at the following CSS code:

The code is as follows: Copy code
* {Padding: 0; margin: 0; font-size: 12 px; line-height: 1.7;
Font-family: Verdana, "", Arial; list-style: none ;}
A: link, a: visited {background: # D3DFFA; padding-left: 23px; color: #036; text-decoration: none ;}
A: hover, a: active {color: #000; background-color: # ADC2F5 ;}
A {display: block; border-bottom: 1px solid # fff; padding-left: 10px; width: Pixel ;}
Ul {background: # fff; width: 150px; border: 1px solid # 06f;
Margin: 0px 20px-1px 20px; padding: 1px ;}
Span {display: block; background: #036; padding-left: 13px; color: # fff ;}
Related Article

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.