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

              
                h1 Inline SVG testing

p After some problems with Modernizr tests I found about SVGRect in this <a href="http://stackoverflow.com/a/28239372/2728847"target="_blank">Stackoverflow answer</a> and I am testing this against Modernizr's test to see which is more reliable.

p I'm using this pen for testing across browsers.

p.modernizr
p.svgrect

svg(viewBox="0 0 200 200" version="1.1" style="width: 100px; height: 100px;")
    circle(cx="100" cy="100" r="80" fill="green" stroke ="darkgreen" stroke-width ="10")
    
p Results:
table(border="1")
  tr
    td: b Browser
    td: b Modernizr
    td: b SVGRect
  tr
    td Chrome 40 for Mac
    td.success Test is successful
    td.success Test is successful
  tr
    td Firefox 36.0.1 for Mac
    td.success Test is successful
    td.success Test is successful
  tr
    td Firefox 35.0.1 for Mac
    td.success Test is successful
    td.success Test is successful
  tr
    td Safari Mac 8.0.2
    td.success Test is successful
    td.success Test is successful
  tr
    td Internet Explorer 11
    td.success Test is successful
    td.success Test is successful
  tr
    td Internet Explorer 10
    td.success Test is successful
    td.success Test is successful
  tr
    td Internet Explorer 9
    td.success Test is successful
    td.success Test is successful
  tr
    td Internet Explorer 8
    td.success Test is successful
    td.success Test is successful
  tr
    td Safari iOS 5
    td.success Test is successful
    td.success Test is successful
  tr
    td Safari iOS 6
    td.success Test is successful
    td.success Test is successful
  tr
    td Safari iOS 7
    td.success Test is successful
    td.success Test is successful
  tr
    td Safari iOS 8
    td.success Test is successful
    td.success Test is successful
  tr
    td Android 2.2 browser<br> Android Simulator on CrossBrowserTesting
    td.success Test is successful
    td.success Test is successful
  tr
    td Android 2.3 browser<br> Android Simulator on CrossBrowserTesting
    td.success Test is successful
    td.success Test is successful
  tr
    td Android 3.2 browser<br> Samsung Galaxy Tab 10.1 (GT-P7500)
    td.success Test is successful
    td.success Test is successful
  tr
    td Android 4.0 browser<br> Android Simulator on CrossBrowserTesting
    td.success Test is successful
    td.success Test is successful
  tr
    td Android 4.1 browser<br> Galaxy Tab 2 on CrossBrowserTesting
    td.success Test is successful
    td.success Test is successful
  tr
    td Android 4.2 browser<br> <a href="http://app.crossbrowsertesting.com/public/iec9d6738c0f1080/livetests/2764871/snapshots/zdabbc2161a2c802588b" target="_blank">Samsung Galaxy S4 on CrossBrowserTesting</a>
    td.fail Test falied
    td.success Test is successful
  tr
    td Android 4.2.2 browser<br> Samsung Galaxy Y TV custom ROM (GT-S5367)
    td.success Test is successful
    td.success Test is successful
  tr
    td Opera Mini 7.6 on Android 4.2.2<br> Samsung Galaxy Y TV custom ROM (GT-S5367)
    td.success Test is successful
    td.fail Test failed
  tr
    td Chrome 40 on Android 4.4.4<br> Moto G 2
    td.success Test is successful
    td.success Test is successful
  tr
    td Android 4.4.4 browser<br> Galaxy S5 on CrossBrowserTesting
    td.success Test is successful
    td.success Test is successful
  tr
    td Android 5.0 browser<br> Android x86 on VirtualBox
    td.success Test is successful
    td.success Test is successful
  tr
    td Blackberry Browser<br> Bold 9900 on CrossBrowserTesting
    td.success Test is successful
    td.success Test is successful
  tr
    td Windows Phone 8
    td.success Test is successful
    td.success Test is successful

  p: b The test is successful when it detects correctly if the browser supports or not SVG.
              
            
!

CSS

              
                body {
  padding: 2em;
}

.success {
  color: green;
}

.fail {
  color: red;
}

table td {
  padding: 8px;
}
              
            
!

JS

              
                var modernizrTest = document.querySelector(".modernizr"),
    svgrectTest   = document.querySelector(".svgrect");

// Modernizr's test
if (Modernizr.inlinesvg) {
  modernizrTest.innerHTML = "<b>Modernizr</b> says that your browser supports SVG. If you see a green circle the test works.";
  modernizrTest.style.color = "green";
} else {
   modernizrTest.innerHTML = "<b>Modernizr</b> says that your browser doesn't supports SVG. If you can't see a green circle the test works.";
   modernizrTest.style.color = "red";
};

// SVGRect's test
if (typeof SVGRect != "undefined") {
  svgrectTest.innerHTML = "<b>SVGRect</b> says that your browser supports SVG. If you see a green circle the test works.";
  svgrectTest.style.color = "green";
} else {
   svgrectTest.innerHTML = "<b>SVGRect</b> says that your browser doesn't supports SVG. If you can't see a green circle the test works.";
   svgrectTest.style.color = "red";
}
              
            
!
999px

Console