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

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.

              <h1 class="text-center">Blink dropdown menu</h1>
<p class="text-center">A dropdown menu that has a blink animation when an item is selected.<br>Inspired by Mac OS menus.</p>

<div class="dropdown">
  <button class="btn-dropdown" type="button" data-toggle="dropdown">
    <span class="caret"></span>
  <ul id="dropdown-menu" class="closed">
    <li><a href="#">First item</a></li>
    <li><a href="#">Second item</a></li>
    <li><a href="#">Third item</a></li>
    <li><a href="#">Fourth item</a></li>
    <li><a href="#">Fifth item</a></li>

              @import "bourbon";

$blue: #3498DB;
$gray: #EEE;

body {
  margin: 40px;
  font-family: Arial, sans-serif;
  font-size: 15px;

.text-center {
  text-align: center;

.graphic {
  margin: 0 auto;
  display: block;

.dropdown {
  display: inline-block;
  position: relative;
  left: 50%;
  margin-top: 20px;
  margin-left: -60px;

button {
  background: $blue;
  border: 0;
  color: #FFF;
  outline: none;
  border-radius: 6px;
  padding: 12px 14px;
  cursor: pointer;
  font-size: 14px;
  &:hover {
    background: darken($blue, 10%);

.caret {
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 2px;
  vertical-align: middle;
  border-top: 8px dashed;
  border-right: 6px solid transparent;
  border-left: 6px solid transparent;

#dropdown-menu {
  background: $gray;
  overflow: hidden;
  border-radius: 6px;
  list-style: none;
  margin: 5px 0 0 0;
  padding: 0;
  width: 200px;
  visibility: hidden;
  opacity: 0;
  @include transition(all 500ms);
  &.open {
    visibility: visible;
    opacity: 1;
    @include transition(none);
  li {
    &:hover {
     background: $blue;
      a {
        color: #FFF;
  a {
    display: block;
    padding: 10px;
    color: #000;
    text-decoration: none;

@include keyframes(flash) {
   0%, 30%, 100%    { color: #000; background: $gray; } 
   15%              { color: #FFF; background: $blue; } 

.flash { 
  @include animation-name(flash);
  @include animation-duration(600ms);
              $('.btn-dropdown').click (e) ->
  $('#dropdown-menu').toggleClass 'open'
  $('#dropdown-menu li a').removeClass()
$('#dropdown-menu li a').click (e) ->
  $(this).addClass "flash"
  $('#dropdown-menu').removeClass 'open'
$('html').click ->
  $('#dropdown-menu').removeClass 'open'

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