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>HTML Buddies: <code>&lt;del&gt;</code> & <code>&lt;ins&gt;</code></h1>

  <p>
    These styles may not be beautiful (they aren’t), but they work for screen reader users who cannot see them (including multilingual support), they work in Windows High Contrast Mode (WHCM), and they work when printed. That means you can steal the CSS and fold it into your own eye-catching styles to make them accessible. Also, the contrast in these examples is sufficient, but be sure your own styles have good contrast too.
  </p>

  <h2>Deleted Text</h2>

  <p>
    Using the <code>&lt;del&gt;</code> element on <del>text that we are indicating is deleted</del>. It should be obvious which text we just cut.
  </p>

  <h2>Inserted Text</h2>

  <p>
    Opposite of the last one, this is <ins>text that we are indicating has been added</ins>. We do this with the <code>&lt;ins&gt;</code> element.
  </p>

  <h2>References</h2>

  <ul>
    <li>
      Read more in my blog post <a href="http://adrianroselli.com/2017/12/tweaking-text-level-styles.html"><cite>Tweaking Text Level Styles</cite></a>, where I also discuss <code>&lt;mark&gt;</code> and <code>&lt;s&gt;</code>. I have screen shots of print styles and WHCM, and videos of screen readers.
    </li>

    <li>
      This pen is for the May 2018 week 1 CodePen challenge, <a href="https://codepen.io/challenges/2018/may/">HTML Buddies</a>.
    </li>
    
    <li>
      You can see a <a href="https://blog.codepen.io/2018/05/14/html-buddies-may-codepen-challenges/">wrap-up of week 1 on the CodePen blog</a>.
    </li>
    
    <li>
      See <a href="http://adrianroselli.com/2018/06/codepen-html-buddies-challenge.html" target="_top">all four of my pens for this challenge</a> at my site with additional context.
    </li>
  </ul>

</main>
              
            
!

CSS

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

body {
  background-color: #a08caf;
  color: #333;
  font-family: Lato, Arial, sans-serif;
  padding: 0;
  margin: 0;
  line-height: 1.5;
}

li:not(:first-of-type) {
  margin-top: 1em;
}

code {
  font-family: 'VT323', 'Courier New', Courier, monospace;
  font-size: 110%;
  font-weight: normal;
  font-variant-ligatures: none;
  padding: 0.05em 0.25em;
  background-color: rgba(255, 255, 255, 0.75);
  border-radius: 0.5em;
  box-decoration-break: slice;
}

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

/* Base styles */
del {
  text-decoration: line-through;
}

ins {
  text-decoration: none;
  border-bottom: 0.2em double #080;
}

/* Screen-reader styles */
del::before,
del::after,
ins::before,
ins::after {
  /* Common style for visually-hiding content */
  clip-path: inset(100%);
  clip: rect(1px, 1px, 1px, 1px);
  height: 1px;
  width: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
}

del::before {
  content: " [deletion start] ";
}

del::after {
  content: " [deletion end] ";
}

ins::before {
  content: " [insertion start] ";
}

ins::after {
  content: " [insertion end] ";
}

/* Screen-reader styles in Spanish */
:root:lang(es) del::before {
  content: " [inicio de eliminación] ";
}

:root:lang(es) del::after {
  content: " [fin de eliminación] ";
}

:root:lang(es) ins::before {
  content: " [inicio de inserción] ";
}

:root:lang(es) ins::after {
  content: " [fin de inserción] ";
}

/* Windows High Contrast Mode styles */
@media screen and (-ms-high-contrast: active) {
  ins {
    border-bottom-color: Highlight;
  }
}

/* Print styles */
@media print {
  ins {
    border-bottom-width: 3pt;
  }
}

              
            
!

JS

              
                
              
            
!
999px

Console