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

              
                <!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=" />
  <title>CSS Text</title>
  <style>
    #textcolor {
      color: red;
    }

    #textalign1 {
      width: 300px;
      text-align: justify;
    }

    #textalign2 {
      width: 300px;
      text-align: center;
    }

    h1.textdecoration {
      text-decoration: overline;
    }

    h2.textdecoration {
      text-decoration: line-through;
    }

    h3.textdecoration {
      text-decoration: underline;
    }

    #remove {
      text-decoration: none;
      border-bottom: 1px dotted;
    }

    #remove:hover {
      border-bottom: none;
    }

    h1.texttransform {
      text-transform: uppercase;
    }

    h2.texttransform {
      text-transform: capitalize;
    }

    h3.texttransform {
      text-transform: lowercase;
    }

    #textindent {
      text-indent: 100px;
      width: 300px;
    }

    #letterspace1 {
      letter-spacing: 3px;
    }

    #letterspace2 {
      letter-spacing: 10px;
    }

    p.ws1 {
      word-spacing: 20px;
    }

    p.ws2 {
      width: 150px;
      word-spacing: 20px;
      text-align: justify;
    }

    p.ws3 {
      word-spacing: 20px;
      white-space: pre;
    }
  </style>
</head>

<body>
  <h2>Text Color Property</h2>
  <p id="textcolor">This is a simple paragraph of text.</p>
  <hr />
  <h2>Text Alignment Property</h2>
  <p id="textalign1">
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam eu sem
    tempor, varius quam at, luctus dui. Mauris magna metus, dapibus nec turpis
    vel, semper malesuada ante. Vestibulum id metus ac nisl bibendum
    scelerisque non non purus. Suspendisse varius nibh non aliquet sagittis.
  </p>
  <p id="textalign2">
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam eu sem
    tempor, varius quam at, luctus dui. Mauris magna metus, dapibus nec turpis
    vel, semper malesuada ante. Vestibulum id metus ac nisl bibendum
    scelerisque non non purus. Suspendisse varius nibh non aliquet sagittis.
  </p>
  <hr />
  <h2>Text Decoration Property</h2>
  <h1 class="textdecoration">This is heading 1</h1>
  <h2 class="textdecoration">This is heading 2</h2>
  <h3 class="textdecoration">This is heading 3</h3>
  <hr />
  <h2>Removing the Default Underline from HTML Links</h2>
  <p>Place your mouse pointer <a id="remove" href="#">over me!</a></p>
  <hr />
  <h2>Text Transform Property</h2>
  <h1 class="texttransform">This is heading 1</h1>
  <h2 class="texttransform">This is heading 2</h2>
  <h3 class="texttransform">This is heading 3</h3>
  <hr />
  <h2>Text Indentation Property</h2>
  <p id="textindent">
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam eu sem
    tempor, varius quam at, luctus dui. Mauris magna metus, dapibus nec turpis
    vel, semper malesuada ante. Vestibulum id metus ac nisl bibendum
    scelerisque non non purus. Suspendisse varius nibh non aliquet sagittis.
  </p>
  <hr />
  <h2>Letter Spacing Property</h2>
  <p id="letterspace1">This is a simple paragraph of text.</p>
  <p id="letterspace2">This is a simple paragraph of text.</p>
  <hr />
  <h2>Word Spacing Property</h2>
  <p class="ws1">This is a normal paragraph.</p>

  <p class="ws2">
    Note that spacing between the words of this paragraph are varying in order
    to justify the text even if the value of word-spacing property is set to
    20px.
  </p>

  <p class="ws3">
    Note that spacing between the words of this paragraph are higher than the
    normal spacing even if whitespace are preserved.
  </p>
</body>

</html>
              
            
!

CSS

              
                
              
            
!

JS

              
                
              
            
!
999px

Console