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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

              
                <!-- fun CSS image and animation effects! -->
<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
	<link rel="preconnect" href="https://fonts.googleapis.com" />
	<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
	<link href="https://fonts.googleapis.com/css2?family=Orbitron&display=swap" rel="stylesheet" />
	<link rel="preconnect" href="https://fonts.googleapis.com" />
	<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
	<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@300&display=swap" rel="stylesheet" />
	<link rel="stylesheet" href="mystyles.css" />
	<title>CSS Transitions/Transforms</title>
</head>

<body>
	<main>
		<!-- HEADER -->
		<header class="hero">
			<h1>A galaxy so vast</h1>
			<article>
				<p>
					"There may be aliens in our Milky Way galaxy, and there are
					billions of other galaxies. The probability is almost certain
					that there is life somewhere in space." -Buzz Aldrin
				</p>
				<a href="https://unsplash.com/s/photos/galaxy" target="_blank">Explore more galaxy photos</a>
			</article>
		</header>
		<!-- CONTAINER -->
		<section class="container">
			<h4>
				A huge collection of gas, dust, and billions of stars and their
				solar systems, all held together by gravity.
			</h4>
			<!-- GRID -->
			<div class="grid">
				<div class="grid-item">
					<a href=""><img src="https://images.unsplash.com/photo-1464802686167-b939a6910659?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=2050&q=80" id="img1" alt="Photo by Jeremy Thomas on Unsplash" /></a>
				</div>
				<div class="grid-item">
					<a href=""><img src="https://images.unsplash.com/photo-1528722828814-77b9b83aafb2?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=2070&q=80" id="img2" alt="Photo by Andy Holmes on Unsplash" /></a>
				</div>
				<div class="grid-item">
					<a href=""><img src="https://images.unsplash.com/photo-1538370965046-79c0d6907d47?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=2069&q=80" id="img3" alt="Photo by Graham Holtshausen on Unsplash" /></a>
				</div>
				<div class="grid-item">
					<a href=""><img src="https://images.unsplash.com/photo-1502134249126-9f3755a50d78?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=2070&q=80" id="img4" alt="Photo by Shot by Cerqueira on Unsplash" /></a>
				</div>
			</div>
		</section>
	</main>
	<!-- FOOTER -->
	<footer>
		<p>Developed by Raya Bergin &copy; v2-4Feb2022</p>
		<p>Photo (as header background) by Jake Weirick on Unsplash</p>
	</footer>
</body>

</html>
              
            
!

CSS

              
                /* MY TEMPLATE RESET */
* {
	/* Outline to view layout on screen while styling | Remove after styling */
	outline: 1px dashed #ff0075;
	margin: 0;
	padding: 0;
}
html {
	box-sizing: border-box;
	font-size: 100%;
}
*,
*:before,
*:after {
	box-sizing: inherit;
}

/* color variables */
:root {
	--aquamarine-blue: #78cce2;
	--dark-green-blue: #002439;
	--light-aqua: #e4eff0;
	--gray-blue: #4e7988;
	--green-blue: #005066;
}

/* BASIC styles */
body {
	font-family: "Open Sans", sans-serif;
	width: 100%;
	max-width: 75%;
	margin: 0 auto;
	background-color: var(--aquamarine-blue);
	color: var(--dark-green-blue);
}
main {
	background-color: var(--light-aqua);
}

/* HEADER */
.hero {
	background: url(https://images.unsplash.com/photo-1520034475321-cbe63696469a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=2070&q=80)
		center;
	background-size: cover;
	padding: 4em 2em;
	/* h1 grid style */
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(15em, 1fr));
	align-items: center;
	color: var(--light-aqua);
}
.hero h1 {
	font-family: "Orbitron", sans-serif;
	font-size: 3.75rem;
	padding-bottom: 1em;
}
.hero article p {
	font-size: 1.5rem;
	line-height: 1.5;
}
.hero article a {
	padding: 1em;
	margin-top: 1em;
	text-transform: uppercase;
	background-color: var(--gray-blue);
	color: var(--light-aqua);
	text-decoration: none;
	border-radius: 0.25em;
	text-align: center;
	display: inline-block;
	transition-property: all 0.5s;
}
.hero article a:hover {
	opacity: 0.85;
}

/* CONTAINER */
.container {
	padding: 2em;
	/* min-width: 25em; */
}
.container h4 {
	font-family: "Orbitron", sans-serif;
	font-size: 1.25rem;
	color: var(--green-blue);
	padding: 1em 0;
	margin: 1em 0;
}

/* GRID */
.grid {
	margin: 1em 0;
	padding: 3.5em 0;
	display: grid;
	grid-gap: 1.25em;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	justify-content: center;
}
/* grid item */
.grid-item img {
	object-fit: cover;
	width: 100%;
	max-width: 100%;
	height: auto;
	border-radius: 0.5em;
	box-shadow: 2px 2px 2px rgba(0, 36, 57, 0.4);
	transition: transform 0.4s ease-in-out;
}
/* grid item transitions/transforms */
.grid-item a:hover #img1,
.grid-item a:focus #img1 {
	transform: rotate(-15deg) scale(1.5);
	transform-origin: center bottom;
}
.grid-item a:hover #img2,
.grid-item a:focus #img2 {
	transform: skewX(15deg) scale(1.25);
	filter: saturate(3);
}
.grid-item a:hover #img3,
.grid-item a:focus #img3 {
	transform: translate(-5%, -25%) scale(1);
}
.grid-item a:hover #img4,
.grid-item a:focus #img4 {
	transform: rotate(30deg) scale(1.5);
	transform-origin: 100% 0%;
	filter: grayscale(100%);
}
.grid-item a:hover img {
	box-shadow: 6px 6px 6px rgba(0, 36, 57, 0.3);
}

/* FOOTER */
footer {
	background-color: var(--dark-green-blue);
	padding: 1em;
	color: var(--light-aqua);
	text-align: center;
}

/* laptop */
/* max-width 64em (1024px) */
@media (max-width: 64em) {
	/* BASIC styles */
	body {
		max-width: initial;
	}
	/* HEADER */
	.hero {
		padding: 3em 2em;
	}
	.hero h1 {
		font-size: 2.75rem;
	}
	.hero article p {
		font-size: 1.25rem;
	}
}

              
            
!

JS

              
                
              
            
!
999px

Console