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-style: none; } li { float:left; font: 14px/10pxArial, Verdana, sans-serif; color:#FFF; background-color:#CCCC00; width: 80px; height: 80px; padding:20px; margin:030px00; -webkit-border-radius: 60px; -moz-border-radius: 60px; border-radius: 60px; } |
Fourth Step: Set the alignment of the menuIn 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; width: 80px; height: 45px; text-align: center; 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 { width: 120px; 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