Sample Code of the second-level drop-down menu implemented by pure CSS, And the css navigation menu

Source: Internet
Author: User

Sample Code of the second-level drop-down menu implemented by pure CSS, And the css navigation menu

Sample Code of the second-level drop-down menu implemented by pure CSS:
The level-2 drop-down menu is applied to many websites. It not only effectively organizes classified navigation, but also saves a lot of website space and achieves dynamic website effects, most level-2 navigation menus are implemented with javascript. This section describes the drop-down menus implemented with pure css.
The Code is as follows:

 

<! DOCTYPE html> 

 

The above Code meets our requirements, and uses pure css to implement the drop-down navigation menu effect. In earlier versions of IE browsers, there are compatibility issues, but you don't have to worry about it, because you don't have to worry about it soon, there will be fewer and fewer IE6 users. The following briefly introduces its implementation principles.
Implementation principle:
1. horizontal arrangement of the main navigation:
The horizontal arrangement effect of the main navigation is very simple, as long as the outermost li element is added to the floating.
2. Core Structure:

 

<Li> <a> ant tribe </a> <ul> <li> <a href = "#"> div css tutorial </a> </li> <li> <a href = "#"> javascript tutorial </a> </li> <a href = "#"> jQuery tutorial </a> </li> <li> <a href = "#"> html tutorial </a> </li> <a href = "#"> json tutorial </a> </li> <li> <a href = "#"> ajax tutorial </a> </li> </ul> </li>

 

By default, the ul element in the inner layer is hidden, that is, only the main navigation is displayed by default, when the mouse is hovering over the main navigation, the ul element in the inner layer is displayed and set to absolute positioning. Meanwhile, the left and top attribute values are adjusted to achieve the drop-down menu effect.

The original address is: http://www.softwhy.com/forum.php? Mod = viewthread & tid = 12909.

For more information, see: http://www.softwhy.com/divcss/

 

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.