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

              
                <main>

  <h1>Awesome Company</h1>

  <p>
    This demonstrates three different ways to link a block of content in a way that creates the largest hit area. This is a test to gather feedback. The layout represents a common one on the web.
  </p>

  <div>

    <article class="block">
      <a href="https://www.wikipedia.org/">
        <img src="data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 85'%3E%3Cpath d='M38 0H12A12 12 0 0 0 0 12v61a12 12 0 0 0 12 12h26a12 12 0 0 0 12-12V12A12 12 0 0 0 38 0zM12 4h26a8 8 0 0 1 8 8v50H4V12a8 8 0 0 1 8-8zm26 77H12a8 8 0 0 1-8-8v-7h42v7a8 8 0 0 1-8 8z' fill='%23000'/%3E%3Cpath d='M30 72H20a2 2 0 0 0 0 4h10a2 2 0 0 0 0-4z' fill='%23000'/%3E%3C/svg%3E" alt="">
        <h2>The First Example</h2>
        <p>
          This is done by wrapping the header and text both in the same link. No CSS is used to make them block.
        </p>
      </a>
    </article>

    <article class="individual">
      <a href="https://duckduckgo.com/"><img src="data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 90 84.62'%3E%3Cpath d='M27.28 53.71l18.12 15zm18.1 11.49L29 51.61l16.34 13.62zM90 29.69v54.93H0V29.68l9.62-6.31V8.32h23L45.28 0l12.53 8.32h22.56v15zm-9.63 5.94l6-5.08-6-4v9.06zM37.57 8.32h15.31l-7.61-5.05zM12.35 37.71L29 51.61l16.34 13.62 32.31-27.51V11h-65.3v26.71zm-8.7-7.16l6 5v-8.91zm83.62 2.81L45.43 68.79l-18.12-15L2.73 33.32v48.57h84.54V33.36zM44.8 50.74c-7.07 0-13.06-5.17-13.06-13.45 0-8.88 6.16-16.55 15.73-16.55C55 20.75 60 26 60 33.2c0 6.47-3.62 10.26-7.67 10.26-1.72 0-3.32-1.16-3.19-3.79H49c-1.51 2.54-3.49 3.79-6.08 3.79s-4.65-2-4.65-5.43a10.18 10.18 0 0 1 10.19-10.22 11.36 11.36 0 0 1 4.61.9l-1.46 7.8c-.65 3.28-.13 4.78 1.29 4.83 2.2 0 4.65-2.89 4.65-7.89 0-6.25-3.75-10.73-10.43-10.73-7 0-12.93 5.56-12.93 14.31 0 7.2 4.7 11.64 11.08 11.64a13.44 13.44 0 0 0 6.51-1.51l.69 1.84a15.71 15.71 0 0 1-7.67 1.74zm5.3-20.34a7.49 7.49 0 0 0-2.15-.3c-3.79 0-6.85 3.58-6.85 7.76 0 1.9.95 3.28 2.85 3.28 2.5 0 4.78-3.19 5.26-5.86z' fill='%23000'/%3E%3C/svg%3E" alt="Example two."></a>
      <h2><a href="https://duckduckgo.com/">The Second Example</a></h2>
      <p>
        <a href="https://duckduckgo.com/">This wraps the header and text each in their own link, but to the same resource.</a>
      </p>
    </article>

    <article class="after">
      <img src="data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 86 75.97'%3E%3Cpath d='M78 0a8 8 0 0 1 8 8v40a8 8 0 0 1-8 8h-9l1.81 17.78a2 2 0 0 1-3.37 1.63L48 56h-7v3.06A6 6 0 0 1 35 65H20L9.41 75.41A2 2 0 0 1 6 73.62L7.56 65H6a6 6 0 0 1-6-5.94V39.94A6 6 0 0 1 6 34h6V8a8 8 0 0 1 8-8h58zm0 4H20a4 4 0 0 0-4 4v40a4 4 0 0 0 4 4h28.81a2 2 0 0 1 1.41.56l16.09 16-1.5-14.41a2.09 2.09 0 0 1 2-2.19H78a4 4 0 0 0 4-4V8a4 4 0 0 0-4-4zm-7 9a2 2 0 0 1 0 4H27a2 2 0 0 1 0-4h44zm0 13a2 2 0 0 1 0 4H27a2 2 0 0 1 0-4h44zM12 38H6a1.91 1.91 0 0 0-2 1.94v19.12A1.91 1.91 0 0 0 6 61h4a2.09 2.09 0 0 1 2 2.34l-.84 4.84 6.72-6.62a2 2 0 0 1 1.31-.56H35a1.91 1.91 0 0 0 2-1.94V56H20a8 8 0 0 1-8-8V38zm59 1a2 2 0 0 1 0 4H27a2 2 0 0 1 0-4h44z' fill='%23000'/%3E%3C/svg%3E"
        alt="">
      <h2><a href="https://www.nasa.gov/">The Third Example</a></h2>
      <p>
        Only the header is the link here, but CSS is used to expand the hit area around the content.
      </p>
    </article>

  </div>
  
  <p>
    This example is for a Twitter poll (for now). You may <a href="https://twitter.com/aardrian/status/953456269960122368">participate at the original tweet</a> by choosing one and/or replying to the tweet.
  </p>

</main>
              
            
!

CSS

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

body {
  background-color: #6d695c;
  background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAACVBMVEUAAAAAAAAAAACDY+nAAAAAA3RSTlMmDQBzGIDBAAAAG0lEQVR42uXIIQEAAADCMHj/0NdkQMws0HEeAqvwAUGJthrXAAAAAElFTkSuQmCC);
  font-size: 100%;
  color: #333;
  font-family: Lato, Arial, sans-serif;
  padding: 0;
  margin: 0;
}

main {
  display: block;
  box-sizing: border-box;
  width: 90%;
  margin: 1em auto;
  padding: 1em 2em;
  color: #000;
  background-color: rgba(204, 204, 204, 0.8);
  border: 0.07em solid rgba(0, 0, 0, 0.5);
  border-radius: 0.5em;
  max-width: 60em;
}

h2 {
  text-align: center;
}

img {
  height: 4em;
  width: auto;
  display: block;
  margin: 0 auto;
  transition: all .1s ease-in-out;
}

article a,
article a:link,
article a:visited,
article a:hover,
article a:focus,
article a:active {
  text-decoration: none;
  color: #000;
}

main > div {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -1em;
}

article {
  flex: 1 0 10em;
  margin: 0.5em 1em;
}

article h2 a:hover,
article h2 a:focus,
article a:hover h2,
article a:focus h2 {
  text-decoration: underline;
  text-decoration-skip: ink;
  text-decoration-skip-ink: auto;
  color: #00d;
}

article p a:hover,
article p a:focus,
article a:hover p,
article a:focus p,
article.after:hover,
article.after:focus-within {
  color: #00d;
}

article a:hover img,
article a:focus img,
article.after:hover img,
article.after:focus-within img {
  transform: scale(1.2);
}

article.after {
  position: relative;
}

article.after a[href]::after {
  content: "";
  display: block;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
}

              
            
!

JS

              
                
              
            
!
999px

Console