1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> < html xmlns = "http://www.w3.org/1999/xhtml" > < head > < meta http-equiv = "Content-Type" content = "text/html; charset=utf-8" /> < title >纯CSS3打造动感导航条</ title > < style > body{ background:#EDEDED; } .nav{ width:606px; margin:100px auto 0 auto; } li{ width:100px; height:30px; list-style:none; float:left; margin-left:-1px; /*菜单文字排版*/ line-height:26px; text-align:center; letter-spacing:3px; /*设置菜单边框*/ border:1px solid #B2B2B2; border-radius:3px; /*设置菜单阴影*/ -webkit-box-shadow:0 1px 2px #CDCDCD; box-shadow:0 1px 2px #CDCDCD; /*设置菜单动画*/ -webkit-transition:all 0.3s ease; -moz-transition:all 0.3s ease; transition:all 0.3s ease; } a{ width:96px; height:28px; display:inline-block; /*设置链接样式*/ color:#999; font-size:10px; font-family:Verdana,sans-serif; text-decoration:none; /*webkit文字大小*/ -webkit-text-size-adjust:none; /*设置边框*/ border:2px solid #FFF; border-bottom:none; border-radius:3px; /*菜单背景渐变*/ background:-webkit-linear-gradient( top,#FFFFFF 20%,#F3F3F3 85%,#E5E5E5 100%); background:-moz-linear-gradient( top,#FFFFFF 20%,#F3F3F3 85%,#E5E5E5 100%); background:linear-gradient( top,#FFFFFF 20%,#F3F3F3 85%,#E5E5E5 100%); } li:hover{ margin-top:-8px; } a:hover{ color:#777; } </ style > </ head > < body > < div class = "nav" > < li >< a href = "#" >HOME</ a ></ li > < li >< a href = "#" >LIFE</ a ></ li > < li >< a href = "#" >WEB</ a ></ li > < li >< a href = "#" >PHP</ a ></ li > < li >< a href = "#" >PIC</ a ></ li > < li >< a href = "#" >ABOUT</ a ></ li > </ div > </ body > </ html > |