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

              
                <div class="img-wrap">
		<svg viewBox="0 0 600 400" width="0" height="0" xmlns:xlink="http://www.w3.org/1999/xlink">
			<defs>
				<filter id="c1">
					<feColorMatrix in="SourceGraphic"
						type="matrix"
						values="1 1 0 0 0
										1 1 0 0 0
										1 1 0 1 0
										0 0 0 1 0" />
				</filter>
				<filter id="c2">
					<feColorMatrix in="SourceGraphic"
						type="matrix"
						values="1 1 1 -0.1 0
										0 0 0 0 0
										1 1 1 -0.1 0
										0 0 0 1 0" />
				</filter>
				<filter id="c3">
					<feColorMatrix in="SourceGraphic"
						type="matrix"
						values="1 0 0 0 0
										1 0 0 0 0
										1 0 1 0 0
										0 0 0 1 0" />
				</filter>
				<filter id="c4">
					<feColorMatrix in="SourceGraphic"
						type="matrix"
						values="0.75 0.75 0.75 0 0
										1 1 1 0 0
										1 1 1 0 0
										0 0 0 1 0" />
				</filter>
				<filter id="c5">
					<feColorMatrix in="SourceGraphic"
						type="matrix"
						values="0.75 0.75 0 0 0
										0.75 0.75 0 0 0.6
										0 0 0 0 0.6
										0 0 0 1 0" />
				</filter>
				<filter id="c6">
					<feColorMatrix in="SourceGraphic"
						type="matrix"
						values="0.5 0.5 0 0 0.4
										0 0 0 0 0
										1 1 0 0 0.4
										0 -2 0 1 0"
						result="color" />
				</filter>
			</defs>
		</svg>
	
	<figure>
		<img class="img img--1" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/85648/saffy_400px.jpg" alt="Fluffy cat">
		<figcaption>Greyscale, with blue added to the alpha channel</figcaption>
	</figure>
	<figure>
		<img class="img img--2" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/85648/saffy_400px.jpg" alt="Fluffy cat">
		<figcaption>Only red and blue in all channels (no green). Negative values in alpha channel to darken the dark areas.</figcaption>
	</figure>
	<figure>
		<img class="img img--3" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/85648/saffy_400px.jpg" alt="Fluffy cat">
		<figcaption>Red channel values are equal at 100%, blue channel has 100% blue, so the image is greyscale with a blue-ish tinge</figcaption>
	</figure>
	<figure>
		<img class="img img--4" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/85648/saffy_400px.jpg" alt="Fluffy cat">
		<figcaption>Less red than other colours in red, green and blue channels</figcaption>
	</figure>
	<figure>
		<img class="img img--5" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/85648/saffy_400px.jpg" alt="Fluffy cat">
		<figcaption>The dark parts are colorized using the multiplier channel, the light parts use red and green added to the red and green channels</figcaption>
	</figure>
	<figure>
		<img class="img img--6" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/85648/saffy_400px.jpg" alt="Fluffy cat">
		<figcaption>Blown-out blue channel with remaining channels colorized</figcaption>
	</figure>
</div>
              
            
!

CSS

              
                * {
	box-sizing: border-box;
}

svg {
	position: absolute;
}

.img-wrap {
	display: flex;
	flex-wrap: wrap;
}

figure {
	flex: 0 1 50%;
	margin: 0;
	padding: 10px;
}

figcaption {
	margin-top: 10px;
}

.img {
	display: block;
	width: 100%;
	height: auto;
	filter: url(#c1);
}

.img--2 {
	filter: url(#c2);
}

.img--3 {
	filter: url(#c3);
}

.img--4 {
	filter: url(#c4);
}

.img--5 {
	filter: url(#c5);
}

.img--6 {
	filter: url(#c6);
}



              
            
!

JS

              
                
              
            
!
999px

Console