css实现自适应响应式悬浮多级横竖菜单效果代码
代码语言:html
所属分类:菜单导航
代码描述:css实现自适应响应式悬浮多级横竖菜单效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/font-awesome-4.7.0/css/font-awesome.min.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
<style>
html, body, aside {
display: block;
margin: 0;
padding: 0;
}
body {
padding: 40px;
background-attachment: fixed;
background-position: 50% 0;
background-size: cover;
}
aside {
width: 233px;
min-height: 500px;
}
aside.right {
margin-left: auto;
}
a {
text-decoration: underline;
}
a:hover {
text-decoration: none;
}
.bg-red {
background-image: url(//repo.bfw.wiki/bfwrepo/image/61dec27e73ccc.png);
}
.body {
max-width: 1200px;
margin: 0 auto;
}
@media screen and (max-width: 1000px) {
body {
padding: 20px;
}
}
@media screen and (max-width: 767px) {
body {
padding: 10px;
}
aside {
width: auto;
}
}
@import url(css.css);
/**/
/* defaults */
/**/
.sky-mega-menu,
.sky-mega-menu * {
margin: 0;
padding: 0;
outline: none;
border: 0;
background: none;
}
.sky-mega-menu {
font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
/**/
/* level 1 */
/**/
.sky-mega-menu {
position: relative;
z-index: 999;
background: rgba(255,255,255,0.9);
box-shadow: 0 0 20px rgba(0,0,0,.3);
font-size: 0;
line-height: 0;
text-align: right;
}
.sky-mega-menu:after {
content: '';
display: table;
clear: both;
}
.sky-mega-menu li {
position: relative;
display: inline-block;
float: left;
padding: 5px;
border-style: solid;
border-color: rgba(0,0,0,.1);
border-right-width: 1px;
font-size: 13px;
line-height: 45px;
text-align: left;
white-space: nowrap;
}
.sky-mega-menu li a {
display: block;
padding: 0 20px;
text-decoration: none;
color: #666;
transition: background 0.4s, color 0.4s;
-o-transition: background 0.4s, color 0.4s;
-ms-transition: background 0.4s, color 0.4s;
-moz-transition: background 0.4s, color 0.4s;
-webkit-transition: background 0.4s, color 0.4s;
}
.sky-mega-menu li > div {
position: absolute;
z-index: 1000;
top: 100%;
left: -9999px;
margin-top: 8px;
background: rgba(255,255,255,0.9);
box-shadow: 0 0 8px rgba(0,0,0,.3);
opacity: 0;
-o-transform-origin: 0% 0%;
-ms-transform-origin: 0% 0%;
-moz-transform-origin: 0% 0%;
-webkit-transform-origin: 0% 0%;
-o-transition: -o-transform 0.4s, opacity 0.4s;
-ms-transition: -ms-transform 0.4s, opacity 0.4s;
-moz-transition: -moz-transform 0.4s, opacity 0.4s;
-webkit-transition: -webkit-transform 0.4s, opacity 0.4s;
}
.sky-mega-menu li > div:after {
content: '';
position: absolute;
bottom: 100%;
left: 0;
width: 100%;
height: 8px;
background: transparent;
}
.sky-mega-menu li > div:before {
content: .........完整代码请登录后点击上方下载按钮下载查看
















网友评论0