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>Does your browser support SVG <code>lang</code> without the <code>xml</code> prefix?
</h1>
<p>Green is correct; red and crossed-out is not (except for the last line, which tests that the styles are working correctly).  This version uses regional language codes (Canadian English is good, US English is bad, sorry) because Safari wasn't matching any language codes with custom extensions.</p>
<p>Also, all the text spans should be centered; MS Edge is currently messing up the layout of nested tspans.</p>
<h2>Inline SVG:</h2>
<svg>
  <text>
    <tspan x="50%" dy="1.5em" xml:lang="en-ca">
      Basic :lang() support, with prefix</tspan>
    <tspan x="50%" dy="1.5em" lang="en-ca">
      Support without prefix</tspan>
    <a xml:lang="en-ca">
      <tspan x="50%" dy="1.5em">
        Inherited language, with prefix
      </tspan>
    </a>
    <a lang="en-ca">
      <tspan x="50%" dy="1.5em">
        Inherited language, no prefix
      </tspan>
    </a>
    <tspan x="50%" dy="1.5em" xml:lang="en-ca" lang="en-us">
      xml:lang overrides lang</tspan>
    <a xml:lang="en-us">
      <tspan x="50%" dy="1.5em" lang="en-ca">
        lang overrides inherited xml:lang
      </tspan>
    </a>
    <tspan x="50%" dy="1.5em" xml:lang="en-us">
      This one should be crossed-out!</tspan>
  </text>
</svg>
<h2>Embedded .svg file:</h2>
<object type="image/svg+xml"
        data="https://s3-us-west-2.amazonaws.com/s.cdpn.io/91525/svg-lang-test-2.svg"></object>
<h2>:lang support in HTML</h2>
<p>Tests for basic :lang support. Compare <a href="https://codepen.io/AmeliaBR/pen/mAXZOk?editors=1100" target="_blank">with the extended language codes used in the original test case</a>.  
</p>
<ul>
  <li lang="en-ca">Should be coloured green and not crossed out (lang="en-ca")</li>
  <li lang="en-us">Should be colored red and crossed out (lang="en-us")</li>
</ul>

              
            
!

CSS

              
                body {
  background: lightGoldenrodYellow;
  color: midnightBlue;
}
svg, object {
  display: inline-block;
  border: thin gray solid;
  background: lightSkyBlue;
  font: bold x-large sans-serif;
  height: 12em;
  width: 100%;
  min-width: 10em;
  vertical-align: top;
}
text {
  text-anchor: middle;
}
tspan, tspan:lang(en-us) {
  fill: darkRed;
  text-decoration: line-through;
}
tspan:lang(en-ca) {
  fill: darkGreen;
  text-decoration: none;
}
li:lang(en-us) {
  color: darkRed;
  text-decoration: line-through;
}
li:lang(en-ca) {
  color: darkGreen;
}
              
            
!

JS

              
                
              
            
!
999px

Console