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

              
                <article>
    <h1>Accessible "Read More" Links</h1>

    <h2>The Problem</h2>

    <p>Ah yes, the elusive "Read More" link. These are a common design treatment to instruct users to, indeed, read more. Yet, when it comes to an <abbr title="Assistive Technology">AT</abbr> user, links like these give too little context to be meaningful.</p>

    <p>Here's an example of what we're refering to:</p>

    <a href="#" class="read-more no-context">Read More</a>

    <p>If you were using a screen reader right now, how would you know what this link meant? Read more about what?</p>

    <h2>A Solution</h2>

    <p>Here's an easy and effective solution to give users more context:</p>

    <a href="#" class="read-more with-context">Read More <span class="visuallyhidden">about the topic this article is pertaining to.</span></a>

    <p>See any extra text? Me neither. This is the result of the <code>.visuallyhidden</code> CSS class hiding the extra text. If you were to test this with a screen reader, it would read aloud the full text within the <code>&lt;anchor&gt;</code> element
        and the hidden <code>&lt;span&gt;</code> element, giving much more context to the user. This lends further details on what the user is about to click and is indeed what they're looking for.</p>

</article>
              
            
!

CSS

              
                .read-more {
    background-color: Crimson;
    border-radius: 5px;
    color: white;
    display: block;
    margin: 1.5em 0;
    padding: 0.5em;
    text-align: center;
    text-decoration: none;
    width: 6em;
}

.read-more:focus,
.read-more:hover {
    color: White;
}

.no-context {
    background-color: Crimson;
}

.with-context {
    background-color: ForestGreen;
}

.visuallyhidden {
    border: 0;
    clip: rect(0 0 0 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    white-space: nowrap;
}

              
            
!

JS

              
                
              
            
!
999px

Console