扇形多级菜单(纯css)
效果图:
HTML代码:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<link rel="stylesheet" type="text/css" href="css/扇形多级菜单.css"/>
<body>
<div class="menuHodler">
<div class="menuWindow">
<ul class="p1">
<li class="s1"><a href="#url">主菜单</a>
<ul class="p2">
<li class="s2">
<a href="#url"><span>一级菜单1</span></a>
<ul class="p3 a6">
<li><a href="#">二级菜单1</a></li>
<li><a href="#">二级菜单2</a></li>
<li><a href="#">二级菜单3</a></li>
<li><a href="#">二级菜单4</a></li>
<li><a href="#">二级菜单5</a></li>
<li><a href="#">二级菜单6</a></li>
</ul>
</li>
<li class="s2">
<a href="#url"><span>一级菜单2</span></a>
<ul class="p3 a5">
<li><a href="#">二级菜单1</a></li>
<li><a href="#">二级菜单2</a></li>
<li><a href="#">二级菜单3</a></li>
<li><a href="#">二级菜单4</a></li>
<li><a href="#">二级菜单5</a></li>
</ul>
</li>
<li class="s2">
<a href="#url"><span>一级菜单3</span></a>
<ul class="p3 a3">
<li><a href="#">二级菜单1</a></li>
<li><a href="#" οnclick="alert("这是二级菜单")">二级菜单2</a></li>
<li><a href="#">二级菜单3</a></li>
</ul>
</li>
<li class="s2">
<a href="#url"><span>一级菜单4</span></a>
<ul class="p3 a3">
<li><a href="#">二级菜单1</a></li>
<li><a href="#">二级菜单2</a></li>
<li><a href="#">二级菜单3</a></li>
</ul>
</li>
<li class="s2">
<a href="#url"><span>一级菜单5</span></a>
<ul class="p3 a3">
<li><a href="#">二级菜单1</a></li>
<li><a href="#">二级菜单2</a></li>
<li><a href="#">二级菜单3</a></li>
</ul>
</li>
<li class="s2">
<a href="#url"><span>一级菜单6</span></a>
<ul class="p3 a3">
<li><a href="#">二级菜单1</a></li>
<li><a href="#">二级菜单2</a></li>
<li><a href="#">二级菜单3</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
</body>
</html>
css代码:
*{
margin: 0;
padding: 0;
}
body{
background: #B1B1B1;
margin: 0;
padding: 0;
font-size: 14px;
color: black;
}
.menuHodler{
width: 100px;
height: 100px;
position: relative;
z-index: 100;
}
.menuHodler ul{
padding: 0;
margin: 0;
list-style: none;
width: 0;
height: 0;
position: absolute;
top: 0;
left: 0;
}
.menuHodler ul li a{
color: #000;
text-decoration: none;
text-align: center;
font:bold 13px/30px arial,sans-serif;
box-shadow: -5px 7px 10px rgba(0,0,0,0.5);
transform-origin:0 0;
}
.menuHodler ul.p2{
z-index: -1;
}
.menuHodler ul.p3{
z-index: -1;
}
.menuHodler li.s1>a{
position: absolute;
width: 100px;
height: 100px;
display: block;
background: lightseagreen;
border-radius: 0 0 100px 0;
}
.menuHodler li.s2>a{
position: absolute;
width: 100px;
height: 200px;
display: block;
padding-left: 100px;
background: lightgray;
border-radius: 0 0 200px 0;
overflow: hidden;
}
.menuHodler ul.p3 li a{
position: absolute;
display: block;
width: 100px;
padding-left: 200px;
height: 300px;
background: #999;
border-radius: 0 0 300px 0;
overflow: hidden;
}
.menuHodler ul ul{
transform-origin: 0 0 ;
transform: rotate(90deg);
transition: 1s;
}
.menuHodler li .s2:nth-of-type(6)>a{
background: #888;
transform: rotate(75deg);
}
.menuHodler li .s2:nth-of-type(5)>a{
background: #999;
transform: rotate(60deg);
}
.menuHodler li .s2:nth-of-type(4)>a{
background: #AAA;
transform: rotate(45deg);
}
.menuHodler li .s2:nth-of-type(3)>a{
background: #BBB;
transform: rotate(30deg);
}
.menuHodler li .s2:nth-of-type(2)>a{
background: #CCC;
transform: rotate(15deg);
}
.menuHodler .a6 li:nth-of-type(6)>a{
background: #444;
transform: rotate(75deg);
}
.menuHodler .a6 li:nth-of-type(5)>a{
background: #555;
transform: rotate(60deg);
}
.menuHodler .a6 li:nth-of-type(4)>a{
background: #666;
transform: rotate(45deg);
}
.menuHodler .a6 li:nth-of-type(3)>a{
background: #777;
transform: rotate(30deg);
}
.menuHodler .a6 li:nth-of-type(2)>a{
background: #888;
transform: rotate(15deg);
}
.menuHodler .a5 li:nth-of-type(5)>a{
background: #555;
transform: rotate(72deg);
}
.menuHodler .a5 li:nth-of-type(4)>a{
background: #666;
transform: rotate(54deg);
}
.menuHodler .a5 li:nth-of-type(3)>a{
background: #777;
transform: rotate(36deg);
}
.menuHodler .a5 li:nth-of-type(2)>a{
background: #888;
transform: rotate(18deg);
}
.menuHodler .a3 li:nth-of-type(3)>a{
background: #777;
transform: rotate(60deg);
}
.menuHodler .a3 li:nth-of-type(2)>a{
background: #888;
transform: rotate(30deg);
}
.menuHodler li.s1:hover ul.p2{
transform: rotate(0deg);
}
.menuHodler li.s2:hover ul.p3{
transform: rotate(0deg);
}
.menuHodler ul li:hover>a{
background: blue;
color: #FFF;
}
.menuHodler li.s2:hover>a{
background: blue;
color: #FFF;
}
.menuHodler .a6 li:hover>a{
background: blue;
color: #FFF;
}
.menuHodler .a5 li:hover>a{
background: blue;
color: #FFF;
}
.menuHodler .a3 li:hover>a{
background: blue;
color: #FFF;
}
.menuWindow{
width: 110px;
height: 110px;
z-index: 100;
overflow: hidden;
position: absolute;
left: 0;
top: 0;
transition:0s 1s;
}
.menuHodler:hover .menuWindow{
width: 310px;
height: 310px;
transition: 0s 0s;
}