cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

CSS3 Slide Down / Up Menu

A Pen By Captain Anonymous

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

Quick-add: + add another resource

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

Quick-add: + add another resource

Code Indentation


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

              <header class="banner" id="banner">
		<li><a href="#">Link One</a></li>
		<li><a href="#">Link Two</a></li>
		<li><a href="#">Link Three</a></li>
		<li><a href="#">Link Four</a></li>
  <div class="ribbon">
    	<a href="#banner" id="open-menu">Menu</a>
      <a href="#" id="close-menu">Close</a>

              @import "compass/css3";

body { 
  font-family: Georgia, serif;
  font-size: 16px;

.banner {
  position: fixed;
  left: 0; right: 0;
  background: #444;
  height: 50px;
  top: -40px;   
  transition: all 1s ease;
  /* ====================
  I'm doubling-up on the transitions, here,   
  for both :targeted and not-targeted 
  instances. This makes closing the menu just 
  as pleasant. */
  &:target {
    top: 0;
    transition: all 1s ease;
    /* ====================
    Descend the banner when targeted.
    Swap opening and closing links as
    a#open-menu { display: none; }
    a#close-menu {display: block;}
  a#close-menu { display: none; }

/* ====================
Here are some kind of ugly links. */
nav li {
  position: relative;
  list-style-type: none;
  display: inline;

a { color: white; text-decoration: none; }

.ribbon {
  position: absolute;
  top: 0; left: 1em;
  height: 70px;
  h4 {
    position: relative;
    padding-top: 30px; 
    text-align: center;
    a { color: #444; }
    a#open-menu:before {
      content: "↓ ";
      font-size: 1.5em;
      font-weight: bold;
    a#close-menu:before {
      content: "↑ ";
      font-size: 1.5em;
      font-weight: bold;

Loading ..................