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

              
                <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css"> 

<div class="container">
<h4 class="title">
  <span class="lg-icon"><i class="fa fa-picture-o" aria-hidden="true"></i></span> <br />
  SVG Mask on SVG element</h4>
</div>

<!-- SVG markup for the mask -->
<svg class="svg-mask">
 	<defs>
 		<mask id="mask1" maskUnits="objectBoundingBox" maskContentUnits="objectBoundingBox">
    <linearGradient id="grad" gradientUnits="objectBoundingBox" x2="0" y2="1">
      <stop stop-color="white" offset="0"/>
      <stop stop-color="green" stop-opacity="0" offset="1"/>
    </linearGradient>
    <circle cx="0.50" cy="0.50" r="0.50" id="circle" fill="url(#grad)"/>
  	</mask>
 	</defs>
</svg>


<!-- SVG markup for the masked image -->
<svg class="masked-element" width="300" height="300" viewBox="0 0 300 300">
	<image xlink:href="http://www.abbeyjfitzgerald.com/wp-content/uploads/2016/07/forest-example-square.jpg" width="300px" height="300px" />
</svg>
<div class="container">
  <h3>This is a SVG Mask on a SVG Element. Currently works in Webkit, Firefox, IE</h3>
</div>

              
            
!

CSS

              
                html {
  box-sizing: border-box;
}

*,
*:before,
*:after {
  box-sizing: inherit;
}

.lg-icon {
  font-size: 5rem;
}

body {
  font-family: 'Open Sans', sans-serif;
  margin: 0;
  padding: 0;
  background-color: green;
  color: white;
  text-align: center;
}

.container {
  max-width: 90%;
  margin: 0 auto;
  text-align: center;
}

.svg-mask {
  position: absolute;
  width: 0;
  height: 0;
}

.masked-element {
  position: relative;
  display: block;
  margin: 0 auto 20px;
}

.masked-element image {
  mask: url(#mask1);
}

.title {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-transform: uppercase;
  text-align: center;
}
              
            
!

JS

              
                
              
            
!
999px

Console