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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                
<article>
<p>Lorem ipsum <a href="#">dolor sit amet</a>, consectetur adipiscing elit. Proin libero, porttitor a tincidunt ullamcorper. Praesent dapibus quam id quam tristique, eu porttitor nisi condimentum. <a href="#">Aliquam sed ullamcorper</a> turpis, et faucibus ex. Maecenas vitae libero ut nisl rhoncus facilisis. Mauris pellentesque mattis metus a maximus. Cras condimentum ullamcorper <a href="#">risus</a> vel imperdiet. </p>

<p>Lorem ipsum <a href="#">dolor sit amet</a>, consectetur adipiscing elit. Proin libero, porttitor a tincidunt ullamcorper. Praesent dapibus quam id quam tristique, eu porttitor nisi condimentum. <a href="#">Aliquam sed ullamcorper</a> turpis, et faucibus ex. Maecenas vitae libero ut nisl rhoncus facilisis. Mauris pellentesque mattis metus a maximus. Cras condimentum ullamcorper <a href="#">risus</a> vel imperdiet. </p>
  
<p>Lorem ipsum <a href="#">dolor sit amet</a>, consectetur adipiscing elit. Proin libero, porttitor a tincidunt ullamcorper. Praesent dapibus quam id quam tristique, eu porttitor nisi condimentum. <a href="#">Aliquam sed ullamcorper</a> turpis, et faucibus ex. Maecenas vitae libero ut nisl rhoncus facilisis. Mauris pellentesque mattis metus a maximus. Cras condimentum ullamcorper <a href="#">risus</a> vel imperdiet. </p>
  
<p>Lorem ipsum <a href="#">dolor sit amet</a>, consectetur adipiscing elit. Proin libero, porttitor a tincidunt ullamcorper. Praesent dapibus quam id quam tristique, eu porttitor nisi condimentum. <a href="#">Aliquam sed ullamcorper</a> turpis, et faucibus ex. Maecenas vitae libero ut nisl rhoncus facilisis. Mauris pellentesque mattis metus a maximus. Cras condimentum ullamcorper <a href="#">risus</a> vel imperdiet. </p>
 
<p>Lorem ipsum <a href="#">dolor sit amet</a>, consectetur adipiscing elit. Proin libero, porttitor a tincidunt ullamcorper. Praesent dapibus quam id quam tristique, eu porttitor nisi condimentum. <a href="#">Aliquam sed ullamcorper</a> turpis, et faucibus ex. Maecenas vitae libero ut nisl rhoncus facilisis. Mauris pellentesque mattis metus a maximus. Cras condimentum ullamcorper <a href="#">risus</a> vel imperdiet. </p>

<p>Lorem ipsum <a href="#">dolor sit amet</a>, consectetur adipiscing elit. Proin libero, porttitor a tincidunt ullamcorper. Praesent dapibus quam id quam tristique, eu porttitor nisi condimentum. <a href="#">Aliquam sed ullamcorper</a> turpis, et faucibus ex. Maecenas vitae libero ut nisl rhoncus facilisis. Mauris pellentesque mattis metus a maximus. Cras condimentum ullamcorper <a href="#">risus</a> vel imperdiet. </p>
  
<p>Lorem ipsum <a href="#">dolor sipt amet</a>, consectetur adipiscing elit. Proin libero, porttitor a tincidunt ullamcorper. Praesent dapibus quam id quam tristique, eu porttitor nisi condimentum. <a href="#" class="skip-ink-off">Aliquam sed ullamcorper</a> turpis, et faucibus ex. Maecenas vitae libero ut nisl rhoncus facilisis. Mauris pellentesque mattis metus a maximus. Cras condimentum ullamcorper <a href="#">risus</a> vel imperdiet. </p>
  
<p>Lorem ipsum <a href="#">dolor sit amet</a>, consectetur adipiscing elit. Proin libero, porttitor a tincidunt ullamcorper. Praesent dapibus quam id quam tristique, eu porttitor nisi condimentum. <a href="#">Aliquam sed ullamcorper</a> turpis, et faucibus ex. Maecenas vitae libero ut nisl rhoncus facilisis. Mauris pellentesque mattis metus a maximus. Cras condimentum ullamcorper <a href="#">risus</a> vel imperdiet. </p>
  
<p>Lorem ipsum <a href="#">dolor sit amet</a>, consectetur adipiscing elit. Proin libero, porttitor a tincidunt ullamcorper. Praesent dapibus quam id quam tristique, eu porttitor nisi condimentum. <a href="#">Aliquam sed ullamcorper</a> turpis, et faucibus ex. Maecenas vitae libero ut nisl rhoncus facilisis. Mauris pellentesque mattis metus a maximus. Cras <a href="#">condimentum ullamcorper risus vel imperdiet.</a></p>
  
<p>Lorem ipsum <a href="#">dolor sit amet</a>, consectetur adipiscing elit. Proin libero, porttitor a tincidunt ullamcorper. Praesent dapibus quam id quam tristique, eu porttitor nisi condimentum. <a href="#">Aliquam sed ullamcorper</a> turpis, et faucibus ex. Maecenas vitae libero ut nisl rhoncus facilisis. Mauris pellentesque mattis metus a maximus. Cras condimentum ullamcorper <a href="#">risus</a> vel imperdiet. </p>
  
<p>Lorem ipsum <a href="#">dolor sit amet</a>, consectetur adipiscing elit. Proin libero, porttitor a tincidunt ullamcorper. Praesent dapibus quam id quam tristique, eu porttitor nisi condimentum. <a href="#">Aliquam sed ullamcorper</a> turpis, et faucibus ex. Maecenas vitae libero ut nisl rhoncus facilisis. Mauris pellentesque mattis metus a maximus. Cras condimentum ullamcorper <a href="#">risus</a> vel imperdiet. </p>
  
<p>Lorem ipsum <a href="#">dolor sit amet</a>, consectetur adipiscing elit. Proin libero, porttitor a tincidunt ullamcorper. Praesent dapibus quam id quam tristique, eu porttitor nisi condimentum. <a href="#">Aliquam sed ullamcorper</a> turpis, et faucibus ex. Maecenas vitae libero ut nisl rhoncus facilisis. Mauris pellentesque mattis metus a maximus. Cras condimentum ullamcorper <a href="#">risus</a> vel imperdiet. </p>
  
 <p>Lorem ipsum <a href="#">dolor sit amet</a>, consectetur adipiscing elit. Proin libero, porttitor a tincidunt ullamcorper. <em>Praesent dapibus quam id quam tristique, eu porttitor nisi condimentum. <a href="#">Aliquam sed ullamcorper</a> turpis, et faucibus ex. Maecenas vitae libero ut nisl rhoncus facilisis.</em> Mauris pellentesque mattis metus a maximus. <s>Cras condimentum ullamcorper <a href="#">risus</a> vel imperdiet.</s></p>
  
<p>Lorem ipsum <a href="#">dolor sit amet</a>, consectetur adipiscing elit. Proin libero, porttitor a tincidunt ullamcorper. <em>Praesent dapibus quam id quam tristique, eu porttitor nisi condimentum. <a href="#">Aliquam sed ullamcorper</a> turpis, et faucibus ex. Maecenas vitae libero ut nisl rhoncus facilisis.</em> Mauris pellentesque mattis metus a maximus. <s>Cras condimentum ullamcorper <a href="#">risus</a> vel imperdiet.</s></p>
  
<p>Lorem ipsum <a href="#">dolor sit amet</a>, consectetur adipiscing elit. Proin libero, porttitor a tincidunt ullamcorper. <em>Praesent dapibus quam id quam tristique, eu porttitor nisi condimentum. <a href="#">Aliquam sed ullamcorper</a> turpis, et faucibus ex. Maecenas vitae libero ut nisl rhoncus facilisis.</em> Mauris pellentesque mattis metus a maximus. <s>Cras condimentum ullamcorper <a href="#">risus</a> vel imperdiet.</s></p>

</article>
<footer><p>This demo works in the current version of Safari. And in <a href="nightly.mozilla.org">Firefox Nightly</a>, if you turn it on. Support for these three properties will likely ship in Firefox 70, on Oct 22, 2019.</p>
  
<p>To get them to work in Firefox Nightly now, go to <code>about:config</code> in the URL bar. Search for <code>text-</code> and set <code>layout.css.text-underline-offset.enabled</code><code>layout.css.text-decoration-skip-ink.enabled</code> and <code>layout.css.text-decoration-thickness.enabled</code> to true</code>.</p>

<p>These new properties are being defined in <a href="https://drafts.csswg.org/css-text-decor-4">Text Decoration Level 4 Draft</a>. Some details are still being worked out in the specs, so exactly how these properties work <a href="https://github.com/w3c/csswg-drafts/issues?q=is%3Aopen+is%3Aissue+label%3Acss-text-decor-4">might change slightly</a>.</p>

<p>(BTW, there's more about the state of <code>text-decoration-skip-ink</code> vs <code>text-decoration-skip</code> <a href="https://codepen.io/jensimmons/pen/BaBzQRz?editors=1100" target="new">in this demo</a>.)</p>
</footer>

              
            
!

CSS

              
                p a { color: #2a3e3e; }

p:nth-child(1) a {
  /* all default styles */
}

p:nth-child(2) a {
  text-underline-offset: 3px;
}

p:nth-child(3) a {
  color: #1964c6;
  text-underline-offset: 5px;
  text-decoration-thickness: 0.5px;
}

p:nth-child(4) a {
  color: #0b6c82;
  text-underline-offset: 0.3em;
  text-decoration-thickness: 0.2em;
  text-decoration-color: #20a2c0;
}

p:nth-child(5) a {
  text-underline-offset: -0.3em;
  text-decoration-thickness: 0.5em;
  text-decoration-color: #00ffff5e;
  text-decoration-skip-ink: none; /* works in Firefox & Chrome, not in Safari */
  text-decoration-skip: none; /* works in Safari, not in Firefox & Chrome */
}

p:nth-child(6) a {
  text-underline-offset: -0.3em;
  text-decoration-thickness: 0.8em;
  text-decoration-color: #00ffff40;
  text-decoration-skip-ink: none; /* works in Firefox & Chrome, not in Safari */
  text-decoration-skip: none; /* works in Safari, not in Firefox & Chrome */
}
p:nth-child(6) a:hover {
  animation-duration: 0.1s;
  animation-name: hoverslide;
  text-underline-offset: 0.1em;
  text-decoration-thickness: 0.2em;
  text-decoration-color: #00ffffff;
}
@keyframes hoverslide {
  from {
  text-underline-offset: -0.3em;
  text-decoration-thickness: 0.8em;
  text-decoration-color: #00ffff40;
  }
  to {
  text-underline-offset: 0.1em;
  text-decoration-thickness: 0.2em;
  text-decoration-color: #00ffffff;
  }
}

p:nth-child(7) a {
  color: #b50808;
  text-underline-offset: 2px;
  text-decoration-thickness: 5px; 
  text-decoration-style: double;
  text-decoration-color: #b5080838;
}
.skip-ink-off {
  text-decoration-skip-ink: none; /* works in Firefox & Chrome, not in Safari */
  text-decoration-skip: none; /* works in Safari, not in Firefox & Chrome */
}

p:nth-child(8) a {
  color: #44860d;
  text-underline-offset: 3px;
  text-decoration-thickness: 4px; 
  text-decoration-style: dashed;
  text-decoration-color: teal;
  text-decoration-skip-ink: none; /* works in Firefox & Chrome, not in Safari */
  text-decoration-skip: none; /* works in Safari, not in Firefox & Chrome */
}

p:nth-child(9) a {
  color: #373aff;
  text-underline-offset: -0.5em;
  text-decoration-thickness: 0.7em;
  text-decoration-skip-ink: none; /* works in Firefox & Chrome, not in Safari */
  text-decoration-skip: none; /* works in Safari, not in Firefox & Chrome */
  text-decoration-style: dotted;
  text-decoration-color: #ffe88e;
}

p:nth-child(10) a {
  color: #a20ea6;
  text-underline-offset: 5px;
  text-decoration-style: wavy;
  text-decoration-color: #c355c7;
}

p:nth-child(11) a {
  color: #a20ea6;
  text-underline-offset: 5px;
  text-decoration-thickness: 1.5px;
  text-decoration-style: wavy;
  text-decoration-color: #c355c7;
}

p:nth-child(12) a {
  color: #a20ea6;
  text-underline-offset: 4px;
  text-decoration-thickness: 3px;
  text-decoration-style: wavy;
  text-decoration-color: #ffd2da;
}

p:nth-child(13) {
  font-family: Avenir, Roboto, Helvetica, sans-serif;
}
p:nth-child(13) a {
  color: #a20ea6;
  text-decoration: none;
}
p:nth-child(13) em {
  font-style: normal;
  font-weight: bold;
  text-decoration-line: underline;
  text-decoration-style: solid;
  text-decoration-thickness: 0.8em;
  text-underline-offset: -0.5em;
  text-decoration-color: #d0ececd9;
}

p:nth-child(14) {
  font-family: Avenir, Roboto, Helvetica, sans-serif;
}
p:nth-child(14) a {
  color: #a20ea6;
  text-decoration: none;
}
p:nth-child(14) em {
  font-style: normal;
  font-weight: bold;
  box-shadow: 8px 8px #d0ecec;
}
p:nth-child(14) s {
  text-decoration-color: red;
  text-decoration-thickness: 2px;
  text-decoration-style: wavy;
}

p:nth-child(15) {
  font-family: Avenir, Roboto, Helvetica, sans-serif;
}
p:nth-child(15) a {
  color: #a20ea6;
  text-decoration: none;
}
p:nth-child(15) em {
  font-style: normal;
  font-weight: bold;
  background-color: #d0ecec;
}
p:nth-child(15) s {
  text-decoration-color: #199999;
  text-decoration-thickness: 6px;
}



/* Other CSS -------------------------------------------------*/
*  { box-sizing: border-box; }
body { margin: 0; }
html { font-family: 'Merriweather', serif; color: #2a3e3e; }

article {
  margin: 1rem;
  font-size: 1rem;
  line-height: 1.6;
}
p {
  background: #fffcf8;
  padding: 2rem;
  margin: 0;
}
code {
  font-size: 120%;
  background: #eee;
  margin: 0 2px;
  padding: 2px 3px;
  border-radius: 2px;
}
footer {
  font-family: Avenir, Roboto, Helvetica, sans-serif;
  border: 1px solid #ddd; 
  margin: 1rem;
  padding: 1rem 2rem; 
}
footer p {
  margin: 1em 0;
  padding: 0;
  background: none;
}
footer a {
  color: #2a3e3e;
  text-underline-offset: 5px;
  text-decoration-thickness: 0.5px;
}
@media (min-width: 450px) {
  article {
    margin: 3rem;
    font-size: 1.1rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(20em, 1fr)); 
    gap: 2rem;
  }
  footer {
    margin: 3rem;
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console