Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ 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

Auto Save

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

              
                <nav class="menu">
  <a href="#" class="menu__item" data-tooltip="Dashboard">
    <i class="material-icons">home</i>
  </a>
  <a href="#" class="menu__item menu__item--active" data-tooltip="Music Library">
    <i class="material-icons">music_note</i>
  </a>
  <a href="#" class="menu__item" data-tooltip="Statistics">
    <i class="material-icons">timeline</i>
  </a>
  <a href="#" class="menu__item" data-tooltip="Account Security">
    <i class="material-icons">https</i>
  </a>
  <a href="#" class="menu__item" data-tooltip="Settings">
    <i class="material-icons">settings</i>
  </a>
</nav>
<h1>contents here</h1>
              
            
!

CSS

              
                html {
  /* set space for menu to appear, or everything in html will covered 75px by menu  */
  margin-left: 75px;
}

.menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 75px;
  height: 100%;
  background: #eeeeee;
  font-size: 16px;
  font-family: sans-ferif;
}

.menu__item {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 15px 0;
  text-decoration: none;
  color: #666666;
  transition: background 0.3s;
}

.menu__item > i {
  font-size: 2.2em; /* 2.2*16px */
}

.menu__item--active {
  color: #000000;
  background: #dddddd;
}

.menu__item:hover {
  background: #dddddd;
}

/* create tooltip after each menu item  */
.menu__item::after {
  position: absolute;
  display: inline-block; /* ::before, ::after are inline as default
  
  /*  makes tooltip vertically center within each one of menu items  */
  top: 50%;
  transform: translateY(-50%);
  
  /* starting tooltip 100% left of menu item (just the right of them)   */
  left: 100%;
  
  /* linked to the HTML attribute value  */
  /* 使用 ::before 和 ::after 一定要有 content 否則不會發生作用。 */
  content: attr(data-tooltip);
  
  /* set margin between menu item and tooltip  */
  margin-left: 15px;
  
  /* makes words in same line   */
  white-space: nowrap;
  
  padding: 7px 12px;
  
  /* 90% of current font size   */
  font-size: 0.9em;
  font-weight: bold;
  background: rgba(0, 0, 0, 0.8);
  border-radius: 15px;
  color: #fff;
  
  /*  invisible (can't see it but can click on it)  */
  opacity: 0;
  /* can't click  */
  visibility: hidden;
  transition: opacity 1s;
}

/* show tooltip if hover on menu item */
.menu__item:hover::after {
  opacity: 1;
  visibility: visible;
}

              
            
!

JS

              
                
              
            
!
999px

Console