描述:鼠标悬空在导航栏上时,二级导航栏以动画方式旋转出现。
实现代码:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>二级动画导航</title>
</head>
<style>
body {
background-color: #CCC;
}
.menu {
list-style: none;
padding: 0px;
margin: 0px;
height: 58px;
}
.menu ul {
list-style: none;
padding: 0px;
margin: 0px;
}
.menu li {
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #292929), color-stop(100%, #252525));
background: -webkit-linear-gradient(#292929, #252525);
background: linear-gradient(#292929, #252525);
border-bottom: 2px solid #181818;
border-top: 2px solid #303030;
min-width: 160px;
}
.menu>li {
display: block;
float: left;
position: relative;
}
.menu>li:first-child {
border-radius: 5px 0 0;
}
.menu a {
border-left: 3px solid rgba(0, 0, 0, 0);
color: #808080;
display: block;
font-family: 'Lucida Console';
font-size: 18px;
line-height: 54px;
padding: 0 25px;
text-decoration: none;
}
.menu li:hover {
background-color: #1c1c1c;
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #1c1c1c), color-stop(100%, #1b1b1b));
background: -webkit-linear-gradient(#1c1c1c, #1b1b1b);
background: -o-linear-gradient(#1c1c1c, #1b1b1b);
background: linear-gradient(#1c1c1c, #1b1b1b);
border-bottom: 2px solid #222222;
border-top: 2px solid #1B1B1B;
}
.menu li:hover>a {
border-radius: 5px 0 0 0;
border-left: 3px solid #C4302B;