cssAudio - ActiveCSS - 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.

		<ul class='dropdown'>
		     <li id="top"><a href='index.html'>Dropdown</a>
		        <ul class="dropdown-box">
		           <li><a href='#'>item 1</a></li>
		           <li><a href='#'>item 2</a></li>
		           <li><a href='#'>item 3</a></li>
		           <li><a href='#'>item 4</a></li>
		           <li><a href='#'>item 5</a></li>
              @import "compass/css3";

$base : #f0f0f0;
$flat: #e74c3c;
$dark: #1E1E1E;

	background-color: $dark;
	font-family: sans-serif;

@mixin size{
	padding: 13px 30px;
	width: 200px;
	vertical-align: middle;

@mixin position{
	margin-left: -30px;

	text-decoration: none; 
	color: inherit;

ul li{
	list-style: none;

	@include size;
	margin: 0 auto;
	background-color: $flat;
	text-align: center;

.dropdown #top{
	color: $base;
	position: relative;

.dropdown li ul li:hover{
	color: $base;
	background-color: darken($flat, 5%);
	@include size;
	@include position;

.dropdown li ul li{
	@include size;
	@include position;
	color: $dark;
	border-bottom: 1px solid darken($base, 5%);

.dropdown li ul li:first-child{
margin-top: -13px;

.dropdown li .dropdown-box{
	height: 0;
	overflow: hidden;
    display: none;
    background-color: $base;
    width: 100%;
    @include position;
    margin-bottom: -15px;
    margin-top: 13px;
    border-top: 20px solid $dark;
    padding: 0;
    @include size;

.dropdown li:hover .dropdown-box, .dropdown li:active .dropdown-box {
	background-color: $base;
	animation: box 2s ease;
	animation-iteration-count: 1;
	animation-fill-mode: forwards;

@keyframes box {
  from {height: 0;}
  to {height: 203px;}

.dropdown li:hover span{
	width: 0;
	height: 0;
	border-left: 5px solid transparent;
	border-right: 5px solid transparent;
	border-bottom: 10px solid $base;
	margin-top: 42px;
	position: absolute;
	margin-left: -40px;

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.


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