Last active
September 27, 2015 10:28
-
-
Save jsturgis/1255400 to your computer and use it in GitHub Desktop.
Pure css drop down 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
/* episode nav*/ | |
.episode-nav-container{background:#2D2D2D;padding:15px 0;height:26px;} | |
.episode-nav-block{ | |
position:absolute; | |
left: 50%; | |
margin-left: -80px; | |
} | |
.episode-selector:hover{ | |
background:#3C3C3C; | |
border: solid 1px #626262; | |
margin-top:-1px; | |
-webkit-border-radius:5px; | |
-moz-border-radius:5px; | |
border-radius:5px; | |
} | |
.episode-selector:hover .arrow-up{ | |
border-color:#FFF transparent transparent transparent; | |
} | |
.episode-selector:hover .button{ | |
background:#3C3C3C; | |
color:#FFF; | |
margin: 0 1px 2px 1px; | |
} | |
/* sub levels link hover */ | |
.episode-selector ul li:hover a, .episode-selector li:hover li a { | |
background: none; | |
border: none; | |
} | |
.episode-selector ul li:hover .arrow-right{ | |
border-color:transparent transparent transparent #FFF; | |
} | |
/* level 2 list */ | |
.episode-selector ul { | |
display: none; | |
margin: -1px; | |
padding: 0; | |
width: 100%; | |
border: solid 1px #626262; | |
z-index:20; | |
} | |
/* dropdown */ | |
.episode-selector li:hover > ul { | |
display: block; | |
} | |
.episode-selector ul li { | |
margin: 0; | |
background:#2E2E2E; | |
} | |
.episode-selector ul li + li {border-top:solid 1px #626262;} | |
.episode-selector ul li:hover { | |
background:#C1C1C1; | |
} | |
.episode-selector ul a { | |
display:block; | |
padding:5px 10px; | |
font-weight:normal; | |
color:#FFF; | |
position:relative; | |
} | |
.episode-selector ul a { | |
display:block; | |
padding-left:10px; | |
font-weight:normal; | |
} | |
.episode-selector ul li:hover > a{ | |
color:#000; | |
text-shadow: 0 1px 1px #FFF; | |
} | |
/* level 3+ list */ | |
.episode-selector ul ul { | |
left: 100%; | |
margin-top:-26px; | |
position:absolute; | |
-webkit-border-top-left-radius: 5px; | |
-moz-border-radius-topleft: 5px; | |
-webkit-border-top-right-radius: 5px; | |
-moz-border-radius-topright: 5px; | |
border-top-left-radius: 5px; | |
border-top-right-radius: 5px; | |
-moz-box-shadow: 1px 1px 4px #000; | |
-webkit-box-shadow: 1px 1px 4px #000; | |
box-shadow: 1px 1px 4px #000; | |
} | |
/* rounded corners for first and last child */ | |
.episode-selector ul, .episode-selector ul li:last-child{ | |
-webkit-border-bottom-left-radius: 5px; | |
-moz-border-radius-bottomleft: 5px; | |
-webkit-border-bottom-right-radius: 5px; | |
-moz-border-radius-bottomright: 5px; | |
border-bottom-left-radius: 5px; | |
border-bottom-right-radius: 5px; | |
} | |
.episode-selector ul ul li:first-child{ | |
-webkit-border-top-left-radius: 5px; | |
-moz-border-radius-topleft: 5px; | |
-webkit-border-top-right-radius: 5px; | |
-moz-border-radius-topright: 5px; | |
border-top-left-radius: 5px; | |
border-top-right-radius: 5px; | |
} |
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
<div class="episode-nav-container"> | |
<nav id="episode-nav" class="episode-nav-block"> | |
<ul class="list episode-selector clearfix"> | |
<li> | |
<a role="button" class="button medrounded darkgray bold arrow-right-bg"> | |
<?=$season?>, <?=$episode?><span class="arrow arrow-shadow arrow-up"></span> | |
</a> | |
<ul class="seasonList"> | |
<li> | |
<a href="#" class="episode-nav-link"> | |
Season 1<span class="arrow arrow-right"></span> | |
</a> | |
<ul class="episodeList"> | |
<li> | |
<a href="#" class="episode-nav-link"> | |
Episode 1 | |
</a> | |
</li> | |
<li> | |
<a href="#" class="episode-nav-link"> | |
Episode 2 | |
</a> | |
</li> | |
</ul> | |
</li> | |
<li> | |
<a href="#" class="episode-nav-link"> | |
Season 2 <span class="arrow arrow-right"></span> | |
</a> | |
<ul class="episodeList"> | |
<li> | |
<a href="#" class="episode-nav-link"> | |
Episode 1 | |
</a> | |
</li> | |
<li> | |
<a href="#" class="episode-nav-link"> | |
Episode 2 | |
</a> | |
</li> | |
</ul> | |
</li> | |
</ul> | |
</li> | |
</ul> | |
</nav> | |
</div> |
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
/* fix ie6 lack of border transparent support */ | |
.ie6 .arrow-down{ | |
_border-left-color: pink; | |
_border-bottom-color: pink; | |
_border-right-color: pink; | |
_filter: chroma(color=pink); | |
} | |
/* fix ie 7 width 100% issue */ | |
.ie7 .episode-selector ul{ | |
width:156px; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment