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

              
                <div class="message">

    <p>CSS <b>Text Box Trim</b> is a CSS property that allows you to remove the leading whitespace from a block of text. This is useful for removing the space between the top of the text and the top of the container.</p>
    <p><b>Availble under feature flag:</b></p>
    <ul>
        <li>Chrome 128+</li>
        <li>Safari 16.4+ and Safari Technology Preview </li>
    </ul>
</div>

<div class="content">
    <h1>Main Heading (h1)</h1>
    <h2>Subheading (h2)</h2>
    <h3>Sub-subheading (h3)</h3>
    <h4>Smaller heading (h4)</h4>
    <h5>Even smaller heading (h5)</h5>
    <h6>Smallest heading (h6)</h6>

    <p>This is a paragraph element. It contains general text content.</p>
    <p><strong>Strong text</strong> is used to emphasise content.</p>
    <p><em>Emphasised text</em> is typically italicised for emphasis.</p>
    <p><u>Underlined text</u> is also supported.</p>
    <p><mark>Highlighted text</mark> to draw attention.</p>
    <p><del>Deleted text</del> represents something removed or changed.</p>
    <p><ins>Inserted text</ins> is typically underlined and indicates additions.</p>
    <p><small>Small text</small> is used for fine print.</p>
    <p>This text contains <sub>subscript</sub> and <sup>superscript</sup> for scientific or mathematical expressions.</p>
    <blockquote>
        This is a blockquote, typically used for longer quotes or external content.
    </blockquote>

    <p>This is a <code>code</code> element, used for inline code snippets.</p>
    <pre>
This is a preformatted text block,
used to display text exactly as written.
    </pre>

    <p>This is a link to <a href="https://www.example.com">Example Website</a>.</p>

    <p>This is <abbr title="Hypertext Markup Language">HTML</abbr>, an abbreviation example.</p>

    <p>This is text with a <cite>citation</cite>, used to reference a work.</p>

    <p>Keyboard input: <kbd>Ctrl + C</kbd></p>

    <p><b>Bold text</b> is similar to strong text but without the semantic emphasis.</p>
    <p><i>Italic text</i> is similar to emphasised text but without the semantic meaning.</p>

    <p>Definition list example:</p>
    <dl>
        <dt>HTML</dt>
        <dd>Hypertext Markup Language, the language used to structure a web page.</dd>
        <dt>CSS</dt>
        <dd>Cascading Style Sheets, used for styling a web page.</dd>
    </dl>

    <p>List examples:</p>
    <ul>
        <li>Unordered list item 1</li>
        <li>Unordered list item 2</li>
    </ul>
    <ol>
        <li>Ordered list item 1</li>
        <li>Ordered list item 2</li>
    </ol>

    <p>Quotation within text: <q>This is a short quote within a paragraph.</q></p>
</div>
              
            
!

CSS

              
                body {
    font-family: system-ui;

    postive: relative;
    margin-inline: auto;
    max-inline-size: 1100px;

    .message {
        positive: absolute;
        inset-block-start: 10px;
        border: 2px solid rgb(255 152 0);
        background-color: rgb(252, 219, 169);
        padding: 1em;
    }

    .content {
        > * {
            background: rgb(255 122 127 / 10%);

            > * {
                background: rgb(255 122 127 / 25%);
            }
        }
    }
}

:where(h1, h2, h3, h4, h5, h6, p, strong, em, u, mark, del, ins, small, sub, sup, code, pre, b, i, blockquote, q, cite, a, kbd, abbr, dl, dt, dd, ul, li, o) {
    text-box: trim-both cap alphabetic;
}

* {
    margin-block: 0.75em;
}

ul {
    padding-inline-start: 1.25em;
}
pre {
    white-space: normal;
}

              
            
!

JS

              
                
              
            
!
999px

Console