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 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

              
                <h1>Checking To See How Certain Semantic Elements are Read By Screen Readers</h1>
<label for="hover-set">Only show <code>:before/:after</code> (with the orange highlight) on hover</label>
<input type="checkbox" name="hover-set" id="hover-set">
<div class="wrapper">
  <div>
    <h2><code>&lt;mark&gt;</code></h2>
    <p>
      Test, <mark>some text</mark>.
    </p>
    <p>
      Test, <mark class="mark-ba">some more text</mark>.
    </p>
  </div>
  <div>
    <h2><code>&lt;strong&gt;</code></h2>
    <p>Test, <strong>strongly emphasized text</strong>.</p>
    <p>Test, <strong class="strong-ba">other strongly emphasized text</strong>.</p>
  </div>
  <div>
    <h2><code>&lt;em&gt;</code></h2>
    <p>Test, <em>emphasized text</em>,.</p>
    <p>Test, <em class="em-ba">other emphasized text</em></p>
  </div>
  <div>
    <h2><code>&lt;ins&gt;</code></h2>
    <p>Test, <ins>inserted text</ins> end</p>
    <p>Test, <ins class="ins-ba">other inserted text</ins>.</p>
  </div>
  <div>
    <h2><code>&lt;del&gt;</code></h2>
    <p>Test, <del>deleted text</del></p>
    <p>Test, <del class="del-ba">other inserted text</del></p>
  </div>
  <div>
    <h2><code>&lt;data&gt;</code></h2>
    <p>Test, <data value="123-45678-901">some data</data></p>
    <p>Test, <data class="data-ba" value="123-45678-901">some other data</data></p>
  </div>
</div>
              
            
!

CSS

              
                body {
  font-family: sans-serif;
  margin: 0 auto;
  max-width: 80ch;
}

.wrapper {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.wrapper div {
  flex-basis: 300px;
}

:before, :after {
  background-color: #ff6347;
}
.mark-ba:before {
  content: '[Highlight Start]';
}

.mark-ba:after {
  content: '[Highlight End]'
}

.strong-ba:before {
  content: 'Important:  ';
  font-weight: bold;
}

.em-ba:before {
  content: 'Note: ';
  font-weight: italics;
}

.ins-ba:before {
  content: '[Inserted text start]';
}

.ins-ba:after {
  content: '[Inserted text end]';
}

.del-ba:before {
  content: '[deleted text start]';
}

.del-ba:after {
  content: '[deleted text end]';
}

.data-ba:after {
  content: ' (Value: ' attr(value) ')';
}

h1 {
  margin: 0 auto;
}

#hover-set:checked + .wrapper :not(:hover):before,  #hover-set:checked + .wrapper :not(:hover):after{
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}
              
            
!

JS

              
                
              
            
!
999px

Console