Created
October 14, 2017 06:47
-
-
Save anonymous/4e7070fbc3cfef11bf4dff52c4c9ac6e to your computer and use it in GitHub Desktop.
// source http://js.jirengu.com/hirasuxuva
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
<style id="jsbin-css"> | |
.content { | |
width: 600px; | |
margin: 0 auto; | |
} | |
.navbar { | |
background-color: #f1f1f1; | |
list-style: none; | |
margin: 0; | |
padding: 0; | |
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12)!important; | |
} | |
.clearfix { | |
*zoom: 1; | |
} | |
.clearfix:after { | |
content: ''; | |
display: block; | |
clear: both; | |
} | |
.navbar>li { | |
float: left; | |
position: relative; | |
} | |
.navbar li a { | |
display: block; | |
color: #000; | |
text-decoration: none; | |
padding: 8px 16px; | |
} | |
.navbar li a:hover { | |
color: #000; | |
background-color: #ccc; | |
} | |
.navbar li .sub-menu { | |
color: #000; | |
background-color: #fff; | |
display: none; | |
position: absolute; | |
top: 100%; | |
left: 0; | |
min-width: 160px; | |
margin: 0; | |
padding: 0; | |
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12); | |
} | |
.navbar>li:hover .sub-menu { | |
display: block; | |
} | |
</style> | |
</head> | |
<body> | |
<div class="content"> | |
<ul class="navbar clearfix"> | |
<li><a href="#">首页</a></li> | |
<li><a href="#">产品</a></li> | |
<li><a href="#">更多</a> | |
<div class="sub-menu"> | |
<a href="#">关于我们</a> | |
<a href="#">加入我们</a> | |
</div> | |
</li> | |
</ul> | |
</div> | |
<script id="jsbin-source-css" type="text/css">.content { | |
width: 600px; | |
margin: 0 auto; | |
} | |
.navbar { | |
background-color: #f1f1f1; | |
list-style: none; | |
margin: 0; | |
padding: 0; | |
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12)!important; | |
} | |
.clearfix { | |
*zoom: 1; | |
} | |
.clearfix:after { | |
content: ''; | |
display: block; | |
clear: both; | |
} | |
.navbar>li { | |
float: left; | |
position: relative; | |
} | |
.navbar li a { | |
display: block; | |
color: #000; | |
text-decoration: none; | |
padding: 8px 16px; | |
} | |
.navbar li a:hover { | |
color: #000; | |
background-color: #ccc; | |
} | |
.navbar li .sub-menu { | |
color: #000; | |
background-color: #fff; | |
display: none; | |
position: absolute; | |
top: 100%; | |
left: 0; | |
min-width: 160px; | |
margin: 0; | |
padding: 0; | |
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12); | |
} | |
.navbar>li:hover .sub-menu { | |
display: block; | |
}</script> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.content { | |
width: 600px; | |
margin: 0 auto; | |
} | |
.navbar { | |
background-color: #f1f1f1; | |
list-style: none; | |
margin: 0; | |
padding: 0; | |
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12)!important; | |
} | |
.clearfix { | |
*zoom: 1; | |
} | |
.clearfix:after { | |
content: ''; | |
display: block; | |
clear: both; | |
} | |
.navbar>li { | |
float: left; | |
position: relative; | |
} | |
.navbar li a { | |
display: block; | |
color: #000; | |
text-decoration: none; | |
padding: 8px 16px; | |
} | |
.navbar li a:hover { | |
color: #000; | |
background-color: #ccc; | |
} | |
.navbar li .sub-menu { | |
color: #000; | |
background-color: #fff; | |
display: none; | |
position: absolute; | |
top: 100%; | |
left: 0; | |
min-width: 160px; | |
margin: 0; | |
padding: 0; | |
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12); | |
} | |
.navbar>li:hover .sub-menu { | |
display: block; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment