Create gorgeous dynamic CSS3 menus without images and JS

Source: Internet
Author: User

 First step: Edit the HTML code of the menu

The menu contains three list items, named "Menu1", "Menu2", "Menu3", respectively.

?
1234567 <divclass="css3Menus">  <ul>      <li>Menu1</li>      <li>Menu2</li>      <li>Menu3</li>  </ul>  </div>

  Step Two: Set the background of the menu

In this step, we will set the background of the navigation to black. The width, height, and padding are optional and may not be set.

?
1 .css3Menus {  background#14080a;  width:506px;  height:260px;  padding:20px;  }

Step three: Use Border-radius to make circular navigation.

In this step, we'll take advantage of some of CSS3 's cool features, especially Border-radius, to set the background of each list item to yellow and shape to round.

?
1234567891011121314151617 ul {  list-stylenone;  }   li {  float:left;  font14px/10pxArialVerdanasans-serif;  color:#FFF;  background-color:#CCCC00;  width80px;  height80px;  padding:20px;  margin:030px00;  -webkit-border-radius: 60px;  -moz-border-radius: 60px;  border-radius: 60px;  }
 Fourth Step: Set the alignment of the menu

In this step, we'll set a specific background color and location for each list item:

?
li#menu1{  background-color#00FFCC;  }  li#menu2{  background-color#CC9900;  margin-top:100px;  }  li#menu3{  background-color#33FF66;  margin-top:50px;

Fifth step: Set the alignment of links in the menu

?
123456789101112131415161718192021 li a {  color:#FFF;  text-decoration:none;  display:block;  width80px;  height45pxtext-aligncenter;  padding:35px00 0;  margin:040px00;  -webkit-border-radius: 40px;  -moz-border-radius: 40px;  border-radius: 40px;  }  li#menu1a {  background-color#FF0000;  }  li#menu2a {  background-color#660033;  }  li#menu3a {  background-color#66CCCC;  }

Sixth step: Define another effect that unfolds when the mouse hovers over the link

?
1234567891011 li a:hover,  li a:focus,  li a:active {  width120px;  height:65px;  padding:55px0 0 0;  margin:-20px 0 0-20px;  -webkit-border-radius: 60px;  -moz-border-radius: 60px;  border-radius: 60px;  }


 
  Seventh Step: Finally add animation to the navigation?
1234567891011 li a:hover,  li a:focus,  li a:active {  -webkit-animation-name:bounce;  -webkit-animation-duration:1s;  -webkit-animation-iteration-count:4;  -webkit-animation-direction:alternate;  }  @-webkit-keyframes bounce{from{margin:040px 00;}  to{margin:120px 40px 00;}  }
 

Create gorgeous dynamic CSS3 menus without images and JS

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.