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

              
                <div class="wrapper">

  <h1>Tooltips</h1>

  <div>
    <a href="https://www.twitter.com" target="_blank" class="tooltip">
      <i class="fa fa-twitter"></i><span class="tip">Follow Us On Twitter</span>
    </a>
  </div>
  <div>
    <a href="https://www.facebook.com" target="_blank" class="tooltip">
      <i class="fa fa-facebook"></i><span class="tip">Like Our Facebook Page</span>
    </a>
  </div>

  <p>&nbsp;</p>

  <h1>Citations</h1>

  <p>My father had a small estate in Nottinghamshire: <sup><a href="#footnote">[1]</a> <span><cite><a href="https://www.gutenberg.org/files/829/829-h/829-h.htm" target="_blank">Gulliver's Travels </a></cite> by Jonathan Swift, 1726</span></sup> I was the third of five sons. He sent me to Emanuel College in Cambridge at fourteen years old, where I resided three years, and applied myself close to my studies; but the charge of maintaining me,<sup>[2] <span>Part I: A Voyage to Lilliput</span></sup> although I had a very scanty allowance, being too great for a narrow fortune, I was bound apprentice to Mr. James Bates,<sup>[3] <span>Part II: A Voyage to Brobdingnag</span></sup> an eminent surgeon in London, with whom I continued four years.</p>

  <div class="footnotes">
    <p id="footnote">1. ^ If you need footnotes this works too</p>
    <p>2. ^ Another example footnote for demonstration purposes</p>
    <p>3. ^ One more demonstrative footnote here</p>
  </div>

</div>
              
            
!

CSS

              
                * {
  box-sizing: border-box;
}
body {
  font-family: "Open Sans";
  line-height: 1.618em;
  color: #555;
  background: #2c3e50;
}
.wrapper {
  max-width: 50rem;
  width: 100%;
  margin: 2rem auto;
  padding: 5rem;
  background: #fff;
  border: 0.5rem solid #34495e;
}
a {
  text-decoration: none;
  color: #3498db;
}
.fa {
  font-size: 4rem;
  margin: 1rem;
}
.fa-twitter {
  color: #00b0ed;
}
.fa-facebook {
  color: #3b5998;
}
.tooltip {
  position: relative;
}
.tooltip:hover .tip {
  opacity: 1;
  visibility: visible;
  margin-left: 0.5rem;
  transition: all 0.35s;
}
.tip {
  opacity: 0;
  visibility: hidden;
  display: block;
  white-space: nowrap;
  position: absolute;
  z-index: 1;
  left: 100%;
  bottom: 50%;
  padding: 1em;
  margin-left: 0;
  margin-top: 0.5rem;
  font-size: 0.8em;
  font-weight: normal;
  background: #34495e;
  border-radius: 1em;
  color: #fff;
  transition: all 0.35s;
}
.tip::before {
  content: '';
  border-style: solid;
  border-width: 0.5rem 0.625rem 0.5rem 0;
  border-color: transparent #34495e transparent transparent;
  position: absolute;
  right: 100%;
  bottom: calc(50% - 0.5rem);
  width: 0;
  height: 0;
}
sup {
  position: relative;
  cursor: pointer;
}
sup span {
  cursor: default;
  background: #ecf0f1;
  border: 0.125rem solid #3498db;
  position: absolute;
  left: 0;
  bottom: 100%;
  margin: 0 0 0.7em -1em;
  width: 12em;
  padding: 1em;
  line-height: 1.618em;
  opacity: 0;
  visibility: hidden;
  transition: all 0.35s;
}
sup span::before {
  content: '';
  border-style: solid;
  border-width: 0.7em 0.7em 0 0.7em;
  border-color: #3498db transparent transparent transparent;
  position: absolute;
  left: 0.7em;
  bottom: -0.7em;
  width: 0;
  height: 0;
}
sup:hover span {
  opacity: 1;
  visibility: visible;
  transition: all 0.35s;
}
.footnotes {
  margin: 60rem auto;
}
#footnote:target {
  background: #ecf0f1;
}

              
            
!

JS

              
                
              
            
!
999px

Console