Pen Settings

HTML

CSS

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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource

JavaScript

Babel includes JSX processing.

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.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                //- This is called Pug. Which gets compiled into HTML.

nav
    ul#menu
        li
            a(href="#") Skills
        li.hidden
            a(href="#") HTML
        li.hidden
            a(href="#") CSS
        li.hidden
            a(href="#") Javascript
        li.hidden
            a(href="#") Python
        li.hidden
            a(href="#") Flask
        li.hidden
            a(href="#") Nodejs
            
article 
    h1 Easiest Simplest Mobile First CSS Only Responsize Dropdown Menu.
    h1 Shrink window width down below 576px wide to view resposiveness.
              
            
!

CSS

              
                /* Make sure to shrink width of screen down to smartphone size to see the responsiveness. */
:root {
  --gold: #ff8c00;
  --slate: #cccccc;
  --mold: #555555;
  --shadow: #333333;
  --darkness: #111111;
}

html,
body {
  width: 100%;
  height: 100%;
  background-color: var(--gold); /* Gold! */
  /* Make the font look better. */
  font-family: Helvetica, Arial, sans-serif;
}

body {
  margin: 0;
}

nav {
  margin: 0 0.5rem;
}

#menu {
  width: 100%;
  /* Remove default UL padding on the left. */
  padding-left: 0;
  /* Use flexbox to create column. No floats. */
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  /* Remove the bullet points from the LI items. */
  list-style-type: none;
}

li a {
  color: var(--slate);
  font-weight: bold;
  /* Remove underline for hyperlinks. */
  text-decoration: none;
}

li:hover a {
  color: var(--darkness);
}

li {
  padding: 15px;
  /* Create a thin line to seperate list items. */
  margin-bottom: 1px;
  background-color: var(--shadow);
}

li:hover {
  background-color: var(--mold);
}

/* Hide the list items by default mobile first mode. */
.hidden {
  display: none;
}

/* Show the list items on hover. */
#menu:hover .hidden {
  display: block;
}

article {
  padding: 0.5rem;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
}

article h1 {
  margin: 0;
}

/* 
MOBILE FIRST MEDIA QUERY
Screens below 576px wide (smartphones) get the dropdown menu (default behavour).
Screens above 576px wide get the horizontal menu. 
*/
@media only screen and (min-width: 576px) {
  #menu {
    /* Flex back to row in desktop mode. */
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    -ms-flex-direction: row;
    flex-direction: row;
  }
  .hidden {
    /* Unhide the list items in desktop mode. */
    display: block;
  }
  li {
    /* Create a thin line to seperate list items. */
    margin-right: 1px;
  }
}

              
            
!

JS

              
                // No JS!?
              
            
!
999px

Console