-
-
Save michaelmusgrove/5432062 to your computer and use it in GitHub Desktop.
Pure CSS3 Lavalamp Menu
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
*{ | |
margin:0; | |
padding:0; | |
} | |
body { | |
font:14px/1.3 Arial,sans-serif; | |
background-color:#212121; | |
} | |
header { | |
background-color:#212121; | |
box-shadow: 0 -1px 2px #111111; | |
color:#fff; | |
display:block; | |
height:40px; | |
position:relative; | |
width:100%; | |
z-index:100; | |
} | |
header h2{ | |
font-size:22px; | |
font-weight:normal; | |
left:50%; | |
margin-left:-400px; | |
padding:22px 0; | |
position:absolute; | |
width:540px; | |
} | |
header a.stuts,a.stuts:visited{ | |
border:none; | |
text-decoration:none; | |
color:#fcfcfc; | |
font-size:14px; | |
left:50%; | |
line-height:31px; | |
margin:0 0 0 110px; | |
position:absolute; | |
top:0; | |
} | |
header .stuts span { | |
font-size:22px; | |
font-weight:bold; | |
margin-left:5px; | |
} | |
.container { | |
height: 571px; | |
margin: 30px auto; | |
width: 957px; | |
} | |
#nav,#nav ul { | |
list-style: none outside none; | |
margin: 0; | |
padding: 0; | |
} | |
#nav { | |
background: url(http://bit.ly/14Chqrv) no-repeat scroll 0 0 transparent; | |
clear: both; | |
font-size: 12px; | |
height: 58px; | |
padding: 0 0 0 9px; | |
position: relative; | |
width: 957px; | |
} | |
#nav ul { | |
background-color: #222; | |
border:1px solid #222; | |
border-radius: 0 5px 5px 5px; | |
border-width: 0 1px 1px; | |
box-shadow: 0 5px 5px rgba(0, 0, 0, 0.5); | |
left: -9999px; | |
overflow: hidden; | |
position: absolute; | |
top: -9999px; | |
z-index: 2; | |
transform: scaleY(0); | |
} | |
#nav li { | |
background: url('http://bit.ly/178rdD6') no-repeat scroll right 5px transparent; | |
float: left; | |
position: relative; | |
} | |
#nav li a { | |
color: #FFFFFF; | |
display: block; | |
float: left; | |
font-weight: normal; | |
height: 30px; | |
padding: 23px 20px 0; | |
position: relative; | |
text-decoration: none; | |
text-shadow: 1px 1px 1px #000000; | |
} | |
#nav li:hover > a { | |
color: #00B4FF; | |
} | |
#nav li:hover, #nav a:focus, #nav a:hover, #nav a:active { | |
background: none repeat scroll 0 0 #121212; | |
outline: 0 none; | |
} | |
#nav li:hover ul.subs { | |
left: 0; | |
top: 53px; | |
width: 180px; | |
transform: scaleY(1); | |
} | |
#nav ul li { | |
background: none; | |
width: 100%; | |
} | |
#nav ul li a { | |
float: none; | |
} | |
#nav ul li:hover > a { | |
background-color: #121212; | |
color: #00B4FF; | |
} | |
#lavalamp { | |
background: url('http://bit.ly/17LIFi4') no-repeat scroll 0 0 transparent; | |
height: 16px; | |
left: 13px; | |
position: absolute; | |
top: 0px; | |
width: 64px; | |
transition: all 300ms ease; | |
} | |
#lavalamp:hover { | |
transition-duration: 3000s; | |
} | |
#nav li:nth-of-type(1):hover ~ #lavalamp { | |
left: 13px; | |
} | |
#nav li:nth-of-type(2):hover ~ #lavalamp { | |
left: 90px; | |
} | |
#nav li:nth-of-type(3):hover ~ #lavalamp { | |
left: 170px; | |
} | |
#nav li:nth-of-type(4):hover ~ #lavalamp { | |
left: 250px; | |
} | |
#nav li:nth-of-type(5):hover ~ #lavalamp { | |
left: 330px; | |
} | |
#nav li:nth-of-type(6):hover ~ #lavalamp { | |
left: 410px; | |
} | |
#nav li:nth-of-type(7):hover ~ #lavalamp { | |
left: 490px; | |
} | |
#nav li:nth-of-type(8):hover ~ #lavalamp { | |
left: 565px; | |
} |
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
<header> | |
<h2>Pure CSS3 LavaLamp Menu</h2> | |
</header> | |
<div class="container"> | |
<ul id="nav"> | |
<li><a href="#">Home</a></li> | |
<li><a class="hsubs" href="#">Menu 1</a> | |
<ul class="subs"> | |
<li><a href="#">Item 1</a></li> | |
<li><a href="#">Item 2</a></li> | |
</ul> | |
</li> | |
<li><a class="hsubs" href="#">Menu 2</a> | |
<ul class="subs"> | |
<li><a href="#">Item 1</a></li> | |
<li><a href="#">Item 2</a></li> | |
</ul> | |
</li> | |
<li><a class="hsubs" href="#">Menu 3</a> | |
<ul class="subs"> | |
<li><a href="#">Item 1</a></li> | |
<li><a href="#">Item 2</a></li> | |
</ul> | |
</li> | |
<li><a href="#">Menu 4</a></li> | |
<li><a href="#">Menu 5</a></li> | |
<li><a href="#">Menu 6</a></li> | |
<li><a href="#">Back</a></li> | |
<div id="lavalamp"></div> | |
</ul> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment