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

              
                <body>
   <main>
<div>
      <h1>Nat Geo Hover Effect</h1>
      <p><a href="https://www.nationalgeographic.com" target="blank">National Geographic</a> has this simple & stylish hover state that I wanted to disect. It works well for editorial content because it resembles highlighted text.</p>
      <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/508143/catboat.gif"/>
      <p>
"The enterprise started in 1966 when Henriette van Weelde, known locally as the “cat lady,” <a href="https://www.atlasobscura.com/places/de-poezenboot-the-cat-boat" target="blank">began taking in abandoned cats on an old sailing barge she had modified with a cat-friendly interior</a>."
      </p>
      </div>
   </main>
</body>
              
            
!

CSS

              
                @import url("https://fonts.googleapis.com/css?family=Merriweather:400,400i,700");

body {
   font-family: Merriweather, serif;
   font-size: 18px;
}

main {
  width: 70vw;
   height: 100%;
  margin: 20px auto;
  display: flex;
  justify-content: center;
}

div {
   display: flex;
   margin: auto;
   flex-direction: column;
}

img {
  width: 80%;
  height: auto;
}

h1 {
   margin-bottom: 5px;
}

a, a:link {
  color: black;
  text-decoration: none;
  background-position-y: -0%;
  background-image: linear-gradient( white 50%, gold 50%);
  transition: background 500ms ease;
  background-size: 2px;
  background-size: auto 175%;
}

a:hover {
  background-position-y: 100%;

}

              
            
!

JS

              
                
              
            
!
999px

Console