cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmlicon-personicon-teamoctocatspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

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.

            
              link( href='http://fonts.googleapis.com/css?family=Open+Sans:400,800,300' rel='stylesheet' type='text/css' )


h1 A Simple Dropdown Menu

nav.nav
  ul.nav__menu
    li.nav__menu-item
      a Home
    li.nav__menu-item
      a Services
      ul.nav__submenu
        li.nav__submenu-item 
          a Web Design
        li.nav__submenu-item 
          a Web Development
        li.nav__submenu-item 
          a Web Hosting
    li.nav__menu-item
      a About
      ul.nav__submenu
        li.nav__submenu-item 
          a Our Company
        li.nav__submenu-item 
          a Our Team
        li.nav__submenu-item 
          a Our Reach
    li.nav__menu-item
      a Blog
    li.nav__menu-item
      a Contact
            
          
!
            
              $cor-1: #9b59b6;
$cor-2: #ecf0f1;
$cor-3: #27ae60; // green


html {
  box-sizing: border-box;
}

*, *:before, *:after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Open Sans', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  background: $cor-3;
}

nav {
  ul {
    list-style: none;
    padding-left: 0;
    margin-top: 0;
    margin-bottom: 0;
  }
}


h1 {
  width: 500px;
  margin: 100px auto 20px;
  color: #f0f0f0;
  text-align: center;
}

.nav {
  width: 500px;
  margin: 0 auto;
  background: darken( $cor-3, 10% );
  color: #f0f0f0;
  a {
    display: block;
    padding: 0 16px;
    line-height: inherit;
    cursor: pointer;
  }
  
   &__menu {
     line-height: 45px;
     font-weight: 700;
     text-transform: uppercase;
     &-item {
       display: inline-block;
       position: relative;
       
       &:hover {
         background-color: $cor-1;
         
         .nav__submenu {
           display: block;
         }
       }
     }
     
   }
  
  
  &__submenu {
    font-weight: 300;
    text-transform: none;
    display: none;
    position: absolute;
    width: 220px;
    background-color: $cor-1;
    
    &-item {
      &:hover {
        background: rgba( #000, 0.1 );
      }
    }
  }
  
}
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

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

Console