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

              
                <h2>Combined Attribute Selectors</h2>
<p>Here we select the image that has both of these attributes: alt text that contains the word "person" as either the only term or a whole word in a space-separated list, <em>and</em> a src attribute that contains the term "placehold" anywhere.</p>
<p>Note that the image with the alt text "fashion <em>personality</em>" is not selected, and the image with the alt text "famous <em>person</em> Arthur Miller" is not selected because its src attribute does not include "lorem".</p>
<div class="gallery">
  <img src="//placehold.it/150/184/" alt="fashion personality">
  <img src="//s3-us-west-2.amazonaws.com/s.cdpn.io/t-90/greensquare.gif" alt="famous person Arthur Miller">
  <img src="//placehold.it/150/184/" alt="sports person">
</div>
<hr>

<h2>Selecting by Attribute Only</h2>
<p>This example is helpful for debugging CSS &mdash; it will select everything with an inline style attribute and outline it in red.</p>
<div>
  <img style="width: 100px;" src="//placehold.it/300/300" alt="">
  <img src="//placehold.it/100/100/cats" alt="cat">
  <p style="font-size: 1.5em; width: 300px;">There's an inline style on this paragraph.</p>
  <p>There is no inline style on this paragraph.</p>
</div>
              
            
!

CSS

              
                img[alt~="person"][src*="placehold"] { /* selects images with alt text that contains the word "person" as the only term or in a space separated list, and a src attribute that contains the word "placehold" anywhere */
  outline: 5px solid #E18728;
  outline-offset: 2px;
}

[style] { /* select any element with a style attribute and outline it in red */
  outline: 2px solid red; 
}


/* styling for Pen, unrelated to attribute selectors */

body { 
  font-family: sans-serif;
  width: 90%;
  margin: 0 auto;
  line-height: 1.5;
}

img { margin-right: .5em; }

hr { margin: 1em 0; }
              
            
!

JS

              
                
              
            
!
999px

Console