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="example" data-property="background-gradient">
<p>Linear backgrounds</p>
      <div id="b1"></div>
      <div id="b2"></div>
      <div id="b3"></div>
      <div id="b4"></div>
      <div id="b5"></div>
      <div id="b6"></div>
      <div id="b7"></div>
      <div id="b8"></div>
      <div id="b9"></div>
      <div id="b10"></div>
    </div>
<p> By <a href="http://crazyrohila.com" title="sanjay rohila | crazyrohila">me</a></p>
              
            
!

CSS

              
                /**
 * linear-gradient backgrounds.
 */

p {
font-weight:bold;
font-style:italic;
color:#008080;
}

.example > div {
width: 200px;
height: 200px;
float: left;
border-radius: 50%;
margin: 10px;
background-image: linear-gradient(left, red, green);
background-image: -moz-linear-gradient(left center , green, red);
background-size: 20px 20px;
}
#b1 {
background-image: -webkit-linear-gradient(45deg, red 50%, transparent 50%),
	-webkit-linear-gradient(135deg, transparent 50%, green 50%);
background-image: -moz-linear-gradient(45deg, red 50%, transparent 50%),
	-moz-linear-gradient(135deg, transparent 50%, green 50%);
background-image: linear-gradient(45deg, red 50%, transparent 50%),
	linear-gradient(135deg, transparent 50%, green 50%);
}
#b2 {
background-image: -webkit-linear-gradient(45deg, green, transparent 11px, #000);
background-image: -moz-linear-gradient(45deg, green, transparent 11px, #000);
background-image: -o-linear-gradient(45deg, green, transparent 11px, #000);
background-image: linear-gradient(45deg, green, transparent 11px, #000);
background-size: 10px 10px;
}
#b3 {
background-image: -webkit-linear-gradient(-45deg, white 50%, #008080 50%);
background-image: -moz-linear-gradient(-45deg, white 50%, #008080 50%);
background-image: linear-gradient(-45deg, white 50%, #008080 50%);
}
#b4 {
background-image: -webkit-linear-gradient(50deg, white, #008080);
background-image: -moz-linear-gradient(50deg, white, #008080);
background-image: linear-gradient(50deg, white, #008080);
}
#b5 {
background-image: -webkit-linear-gradient(30deg, #0000e0, #e00000);
background-image: -moz-linear-gradient(30deg, #0000e0, #e00000);
background-image: -o-linear-gradient(30deg, #0000e0, #e00000);
background-image: linear-gradient(30deg, #0000e0, #e00000);
background-size: 30px 30px;
}
#b6 {
background-color: teal;
background-image: -webkit-linear-gradient(30deg, #008080, transparent 5px, #fff);
background-image: -moz-linear-gradient(30deg, #008080, transparent 5px, #fff);
background-image: linear-gradient(30deg, #008080, transparent 5px, #fff);
background-size: 5px 5px;
}
#b7 {
background-color: teal;
background-image: -webkit-linear-gradient(30deg, transparent, #008080, transparent 30px, #fff);
background-image: -moz-linear-gradient(30deg, transparent, #008080, transparent 30px, #fff);
background-image: linear-gradient(30deg, transparent, #008080, transparent 30px, #fff);
background-size: 30px 30px;
}
#b8 {
background-color: #fff;
background-image: -webkit-linear-gradient(60deg, transparent, #666, transparent 50px, white);
  background-image: -moz-linear-gradient(60deg, transparent, #666, transparent 50px, white);
  background-image: linear-gradient(60deg, transparent, #666, transparent 50px, white);
background-size: 5px 5px;
}

#b9 {
background-image: -webkit-linear-gradient(60deg, red 50%, green 50%);
background-image: -moz-linear-gradient(60deg, red 50%, green 50%);
background-image: linear-gradient(60deg, red 50%, green 50%);
}
#b10 {
background-color: teal;
background-image: -webkit-linear-gradient(60deg, transparent, #008080, transparent 10px, #fff);
background-image: -moz-linear-gradient(60deg, transparent, #008080, transparent 10px, #fff);
background-image: linear-gradient(60deg, transparent, #008080, transparent 10px, #fff);
background-size: 5px 5px;
}
              
            
!

JS

              
                /**
 * I have tried some background patterns with linear-gradient (ugly one).
 * Most popular and beautiful gallery is avaialable on http://lea.verou.me/css3patterns/.
 */
              
            
!
999px

Console