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="album-cover original">
	<div class="title">Red</div>
	<div class="artist">Taylor Swift</div>
</div>

<div class="albums">
	<div class="album-cover">
		<div class="title blue">Blue</div>
		<div class="artist">Taylor Swift</div>
	</div>

	<div class="album-cover">
		<div class="title cyan">Cyan</div>
		<div class="artist">Taylor Swift</div>
	</div>

	<div class="album-cover">
		<div class="title gold">Gold</div>
		<div class="artist">Taylor Swift</div>
	</div>

	<div class="album-cover">
		<div class="title peru">Peru</div>
		<div class="artist">Taylor Swift</div>
	</div>

	<div class="album-cover">
		<div class="title pink">Pink</div>
		<div class="artist">Taylor Swift</div>
	</div>

	<div class="album-cover">
		<div class="title tan">Tan</div>
		<div class="artist">Taylor Swift</div>
	</div>

	<div class="album-cover">
		<div class="title lime">Lime</div>
		<div class="artist">Taylor Swift</div>
	</div>

	<div class="album-cover">
		<div class="title teal">Teal</div>
		<div class="artist">Taylor Swift</div>
	</div>
</div>
              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&display=swap');

body {
	margin: 20px;
}

.albums {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
}

.album-cover.original {
	display: block;
	margin: 10px auto;
}

.album-cover {
	position: relative;
	width: 500px;
	height: 500px;
	display: block;
	margin: 10px;
	background: url('https://kylephx.com/h/red.jpg') no-repeat top center, red;
	background-size: auto 100%;
	font-family: 'Bebas Neue', cursive;
	text-transform: uppercase;
	text-align: center;
	overflow: hidden;
	
	@media screen and (max-width: 560px) {
		width: 400px;
		height: 400px;
		margin: 10px 0;
	}
	
	@media screen and (max-width: 460px) {
		width: 300px;
		height: 300px;
		margin: 5px 0;
	}
}

.title {
	background-color: rgba(195,0,0,0.75);
	width: 100%;
	color: rgba(0,0,0,0.8);
	margin-top: 123px;
	font-size: 230px;
	font-weight: bold;
	display: inline-block;
	letter-spacing: 0px;
	transform: scale(1.4, 2.2);
	mix-blend-mode: screen;
	
	@media screen and (max-width: 540px) {
		margin-top: 98.4px;
		font-size: 184px;
	}
	
	@media screen and (max-width: 440px) {
		margin-top: 73.8px;
		font-size: 138px;
	}
	
	$colors: blue, cyan, gold, peru, pink, tan, lime, teal;

	@each $color in $colors {
		&.#{$color} {
			background-color: rgba($color, 0.75);
		}
	}
}

.artist {
	color: #fff;
	margin-top: 28px;
	font-size: 45px;
	
	@media screen and (max-width: 540px) {
		margin-top: 22.4px;
		font-size: 36px;
	}
	
	@media screen and (max-width: 440px) {
		margin-top: 16.8px;
		font-size: 27px;
	}
}
              
            
!

JS

              
                
              
            
!
999px

Console