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

              
                <h2>Gift link annotations</h2>

<p>Using a simple CSS <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors">attribute selector</a>, it's possible to add an annotation to denote links to gifted paywalled articles from the NY Times, Washington Post, or The Atlantic that are free to read (for a limited time). Here are three examples; the first link is paywalled and the second link is a gift link and is therefore marked with a "(🎁 link)" by the CSS selector. No Javascript necessary.</p>

<ul>
<li>NY Times: <a href="https://www.nytimes.com/interactive/2023/10/27/technology/twitter-x-elon-musk-anniversary.html">The Consequences of Elon Musk’s Ownership of X</a></li>
<li>NY Times: <a href="https://www.nytimes.com/interactive/2023/10/27/technology/twitter-x-elon-musk-anniversary.html?unlocked_article_code=1.50w.nXNz.9Ev3cJ0IXAEb">The Consequences of Elon Musk’s Ownership of X</a></li>
<li>The Atlantic: <a href="https://www.theatlantic.com/health/archive/2023/10/reasons-to-get-e-bike-emissions-climate-change-benefits/675716/">The Real Reason You Should Get an E-bike</a></li>
<li>The Atlantic: <a href="https://www.theatlantic.com/health/archive/2023/10/reasons-to-get-e-bike-emissions-climate-change-benefits/675716/?gift=j9r7avb6p-KY8zdjhsiSZ11Enw8t2bt7ey6GwJgpB6Q">The Real Reason You Should Get an E-bike</a></li>
<li>Washington Post: <a href="https://www.washingtonpost.com/health/interactive/2023/republican-politics-south-midwest-life-expectancy/">How Red-State Politics Are Shaving Years Off American Lives</a></li>
<li>Washington Post: <a href="https://www.washingtonpost.com/health/interactive/2023/republican-politics-south-midwest-life-expectancy/?pwapi_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyZWFzb24iOiJnaWZ0IiwibmJmIjoxNjk2NDc4NDAwLCJpc3MiOiJzdWJzY3JpcHRpb25zIiwiZXhwIjoxNjk3ODYwNzk5LCJpYXQiOjE2OTY0Nzg0MDAsImp0aSI6IjQ0NTAwZDEzLThiMDYtNDY4OS05Mzc4LWI4NzBlZDI0NTkyZCIsInVybCI6Imh0dHBzOi8vd3d3Lndhc2hpbmd0b25wb3N0LmNvbS9oZWFsdGgvaW50ZXJhY3RpdmUvMjAyMy9yZXB1YmxpY2FuLXBvbGl0aWNzLXNvdXRoLW1pZHdlc3QtbGlmZS1leHBlY3RhbmN5LyJ9.xgDHtqxEFeARlIiS1OJ4IAuHFmY84g9uvB5i8gzQb3k">How Red-State Politics Are Shaving Years Off American Lives</a></li>
</ul>

<p>Note: You can remove the "?" from each selector to be more liberal in selecting parameters wherever they might appear in the query string.</p>
              
            
!

CSS

              
                a[href*="theatlantic.com"][href*="?gift="]::after, a[href*="nytimes.com"][href*="?unlocked_article_code="]::after, a[href*="washingtonpost.com"][href*="?pwapi_token="]::after {
	content: ' (🎁 link)';
}
              
            
!

JS

              
                
              
            
!
999px

Console