A simple example of a pure CSS implementation pull-down menu

Source: Internet
Author: User

You may often use hover this attribute, with hover to achieve the color change of the mouse and so on, in fact, hover is very powerful.

Share a mouse through, pop-up drop-down menu tips;

When we built a list:

<ul>
<li class= "Home" ><a href= "javascript:; target=" _blank "title=" "> Level menu </a></li>
<li class= "Slidewrap" > Level menu
<ul class= "Slide" >
<li><a href= "#" target= "_blank" title= "" > Level two menu </a></li>
<li><a href= "#" target= "_blank" title= "" > Level two menu </a></li>
</ul>
</li>
<li><a href= "javascript:;" target= _blank "title=" "> Level menu </a></li>
<li><a href= "javascript:;" target= _blank "title=" "> Level menu </a></li>

</ul>

We create a list of UL under the first Level menu and show the list hidden:

. slidewrap. Slide {position:absolute; display:none;}

Note that this time need to use positioning to place the level two menu;

And then:

. Slidewrap:hover Slide{display:block}/** slide element is displayed by mouse **/

Slide following the hover, note that it must be in the child element, the mouse through the parent element to achieve this effect.

What do you think? This little trick is simple and practical!

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.