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="nav">
	<a href="#">
		<h1>STEM Initiative</h1>
	</a>
	<ul>

	</ul>
	<button id="darkmode">
		<svg class="moon" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" width="24" height="24" viewBox="0 0 24 24">
			<defs></defs>
			<path d="M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"></path>
		</svg>
	</button>
</div>
<main>
	<section>
		<h1 class="page-title">STEM Initiative's Leadership</h1>
	</section>
	<div class="leadership">
		<div class="leader">
			<div class="leader__header">
				<div class="leader__exp">
					<span class="years">8</span>
					<span>years with STEM Initiative</span>
				</div>
				<a href="#" class="leader__bio">Bio</a>
			</div>
			<div class="leader__img">
				<img src="https://images.unsplash.com/photo-1494790108377-be9c29b29330?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=987&q=80" alt="Amanda Maynard">
			</div>
			<div class="leader__name">
				<h2>Amanda Maynard</h2>
				<p><em>President, STEM</em></p>
			</div>
		</div>

		<div class="leader">
			<div class="leader__header">
				<div class="leader__exp">
					<span class="years">6</span>
					<span>years with STEM Initiative</span>
				</div>
				<a href="#" class="leader__bio">Bio</a>
			</div>
			<div class="leader__img">
				<img src="https://images.unsplash.com/photo-1611432579402-7037e3e2c1e4?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1365&q=80" alt="Sammy Cotillard">
			</div>
			<div class="leader__name">
				<h2>Sammy Cotillard</h2>
				<p><em>Vice President, STEM</em></p>
			</div>
		</div>

		<div class="leader">
			<div class="leader__header">
				<div class="leader__exp">
					<span class="years">5</span>
					<span>years with STEM Initiative</span>
				</div>
				<a href="#" class="leader__bio">Bio</a>
			</div>
			<div class="leader__img">
				<img src="https://images.unsplash.com/photo-1560250097-0b93528c311a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=987&q=80" alt="Todd Fletcher">
			</div>
			<div class="leader__name">
				<h2>Todd Fletcher</h2>
				<p><em>Chief Financial Officer</em></p>
			</div>
		</div>

		<div class="leader">
			<div class="leader__header">
				<div class="leader__exp">
					<span class="years">4</span>
					<span>years with STEM Initiative</span>
				</div>
				<a href="#" class="leader__bio">Bio</a>
			</div>
			<div class="leader__img">
				<img src="https://images.unsplash.com/photo-1601931935821-5fbe71157695?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=927&q=80" alt="Tiffany Edwards">
			</div>
			<div class="leader__name">
				<h2>Tiffany Edwards</h2>
				<p><em>Director of Marketing</em></p>
			</div>
		</div>

		<div class="leader">
			<div class="leader__header">
				<div class="leader__exp">
					<span class="years">3</span>
					<span>years with STEM Initiative</span>
				</div>
				<a href="#" class="leader__bio">Bio</a>
			</div>
			<div class="leader__img">
				<img src="https://images.unsplash.com/photo-1573496359142-b8d87734a5a2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=988&q=80" alt="Chelsea Clayton">
			</div>
			<div class="leader__name">
				<h2>Chelsea Clayton</h2>
				<p><em>Director of Public Relations</em></p>
			</div>
		</div>

		<div class="leader">
			<div class="leader__header">
				<div class="leader__exp">
					<span class="years">2</span>
					<span>years with STEM Initiative</span>
				</div>
				<a href="#" class="leader__bio">Bio</a>
			</div>
			<div class="leader__img">
				<img src="https://images.unsplash.com/photo-1531427186611-ecfd6d936c79?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=987&q=80" alt="Kevin McCallister">
			</div>
			<div class="leader__name">
				<h2>Kevin McCallister</h2>
				<p><em>Art Director</em></p>
			</div>
		</div>
	</div>

</main>
              
            
!

CSS

              
                :root {
	--background: #f5f6fa;
	--page-title: #3b3b98;
	--btn: #dcdde1;
	--btn-text: #b33771;
	--btn-text-hover: #dcdde1;
	--btn-bkg: #b33771;
	--btn-fill: transparent;
	--nav-bkg: rgba(245, 246, 250, 0.75);
	--nav-logo: #b33771;
	--nav-border: rgba(245, 246, 250, 0.2);
	--header-bkg: #3b3b98;
	--bio-text: #fff;
	--bio-bkg: #182c61;
	--bio-bkg-hover: #b33771;
	--name-text: #2c3a47;
	--name-text-hover: #3b3b98;
}

.dark:root {
	--background: #182c61;
	--page-title: #fff;
	--btn-text: #dcdde1;
	--btn-text-hover: #dcdde1;
	--btn-bkg: #273c75;
	--btn-fill: #dcdde1;
	--nav-bkg: rgba(24, 44, 97, 0.75);
	--nav-logo: #fff;
	--nav-border: rgba(24, 44, 97, 0.2);
	--header-bkg: #6d214f;
	--bio-text: #fff;
	--bio-bkg: #b33771;
	--bio-bkg-hover: #3b3b98;
	--name-text-hover: #b33771;
}

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

html {
	font-size: 10px;
}

body {
	background: var(--background);
	display: flex;
	flex-direction: column;
	align-items: center;
}

button {
	border: 0;
	background: none;
	fill: var(--btn-fill);
	color: var(--btn-text);
	line-height: 0;
	padding: 0.8rem;
	border-radius: 2rem;
	display: flex;
	justify-content: center;
	align-items: center;
	transition: 0.2s ease;

	&:hover {
		cursor: pointer;
		background: var(--btn-bkg);
		fill: var(--btn-fill);
		color: var(--btn-text-hover);
	}
}

main {
	max-width: 1200px;
	margin: 0 auto;
	padding: 2rem;
	position: absolute;
	top: 130px;
}

.nav {
	position: fixed;
	z-index: 999;
	display: flex;
	padding: 0.25rem 2rem;
	width: 100%;
	justify-content: space-between;
	align-items: center;
	background: var(--nav-bkg);
	box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(4px);
	border: 1px solid var(--nav-border);

	a {
		text-decoration: none;
		color: var(--nav-logo);
		h1 {
			font-size: 3rem;
			font-weight: 300;
			letter-spacing: 1px;
		}
	}
}

.page-title {
	color: var(--page-title);
	font-size: 4rem;
	margin-bottom: 5rem;
	margin-top: 0;
}

.leadership {
	display: grid;
	// grid-template-rows: repeat(2, 1fr);
	grid-template-columns: 1fr;
	gap: 2rem;

	@media (min-width: 32em) {
		grid-template-columns: repeat(2, 1fr);
	}

	@media (min-width: 50em) {
		grid-template-columns: repeat(3, 1fr);
	}

	.leader {
		width: 100%;
		box-shadow: 0 3px 20px rgba(0, 0, 0, 0.5);

		@media (min-width: 32em) {
			max-width: 300px;
		}

		&:hover {
			cursor: pointer;

			.leader__bio {
				background-color: var(--bio-bkg-hover);
			}
			.leader__img img {
				transform: scale(140%);
				filter: saturate(100%);
			}
			.leader__name {
				color: var(--name-text-hover);
			}
		}

		&__header {
			display: flex;
			justify-content: space-between;
			align-items: center;
			height: 80px;
			background: var(--header-bkg);
			color: #fff;
		}
		&__exp {
			display: flex;
			align-items: center;
			font-size: 1.5rem;
			padding: 1rem 2rem;
			.years {
				font-size: 5rem;
				margin-right: 8px;
				font-weight: 700;
			}
		}
		&__bio {
			padding: 1.5rem 2rem;
			font-size: 2.5rem;
			text-decoration: none;
			color: var(--bio-text);
			height: 100%;
			display: flex;
			flex-direction: column;
			justify-content: center;
			text-align: center;
			background: var(--bio-bkg);
			transition: 0.2s all ease-in-out;
		}
		&__img {
			overflow: hidden;
			width: 100%;
			height: 300px;
			position: relative;
			img {
				position: absolute;
				margin: auto;
				left: 0;
				right: 0;
				text-align: center;
				width: 100%;
				filter: saturate(0%);
				transform: scale(130%);
				transition: 0.2s all ease-in-out;
			}
		}
		&__name {
			text-align: center;
			padding: 1.5rem;
			font-size: 2rem;
			background: #fff;
			display: flex;
			flex-direction: column;
			justify-content: center;
			transition: 0.2s all ease-in-out;
			color: var(--name-text);

			@media (min-width: 32em) {
				font-size: 1.5rem;
			}
			@media (min-width: 50em) {
				font-size: 2rem;
			}

			h2 {
				font-size: 2.5rem;

				@media (min-width: 32em) {
					font-size: 2rem;
				}
				@media (min-width: 50em) {
					font-size: 2.5rem;
				}
			}
		}
	}
}

              
            
!

JS

              
                const modeSwitch = document.querySelector("#darkmode");

modeSwitch.addEventListener("click", function () {
	document.documentElement.classList.toggle("dark");
});

              
            
!
999px

Console