Pure CSS3 Creative navigation menu effects

Source: Internet
Author: User
Brief tutorials

This is a very creative pure CSS3 navigation menu effect. This navigation menu is mainly achieved through the CSS3 transform and Transition methods, which is very simple. This effect is provided by the attacking Ho.

How to use

HTML structure

The navigation menu uses a <nav> element to wrap a set of unordered lists.

<nav>  <ul>      <li><a href= "#" >Home</a></li>      <li><a href= "# ">Docs</a></li>      <li><a href=" # ">Demos</a></li>      <li><a href= "#" > Chinese </a></li>  </ul></nav>

CSS Styles

The navigation menu has a slightly skewed animation of the menu item when the mouse is over the menu item, and two lines slide out of the menu item. The italic animation for a menu item is to rotate and scale the hyperlink element by using the Transform property when it is mouse-over.

Li a {    display:block;    font-size:20px;    Text-align:center;    padding:10px 15px;} Li a:hover {    transform:rotate (5deg) scale (1.1);}

The top and bottom 2 lines of a menu item are made using the hyperlink element: Before and: after pseudo-elements. They start with a transparency of 0, a width of 0, and use the Transform property to rotate and move them.

Li A:before, Li A:after {    opacity:0;    border-top:1px solid white;    Content: ";    Display:block;    position:relative;    Z-index:-1;    Margin:auto;    width:0px;} Li A:before {    top:0px;    Transform:rotate (120deg) Translatey ( -50%) TranslateX ( -50%);} li A:after {    top:5px;    Transform:rotate ( -60deg) Translatey ( -50%) TranslateX (-50%);}

When the mouse is out-of-date, their transparency changes to 1, the width is set to 20 pixels, and a smooth transition with the ease effect.

Li A:hover:before, Li a:hover:after{    transition:all 0.3s ease;    opacity:1;    width:20px;}

The above is pure CSS3 Creative navigation menu effect content, more relevant content please pay attention to topic.alibabacloud.com (www.php.cn)!

  • 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.