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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                article.o-grid
	header.o-grid__area-01.o-header.u-txt-center 
		h3.c-heading.c-heading--05 
			em 1665 – 1736
		h1.c-heading.c-heading--01 Seba
		h2.c-heading.c-heading--02 Albertus Seba
		
	.o-grid__area-02.u-txt-center 
		h4.c-heading.c-heading--03 A Dutch pharmacist, zoologist and collector. He published a Thesaurus of animal specimens with beautiful engravings.
		h5.c-heading.c-heading--04 Taxonomy and natural history
	
	section.o-grid__area-03.o-profile
		.o-profile__inner
			figure.o-media
				img.o-media__img(
src='https://upload.wikimedia.org/wikipedia/commons/d/da/Albertus_Seba_Portrait_farbig.jpg'
alt='Albertus Seba showing a lizard in a bottle'
)
				figcaption.o-media__caption.u-txt-center Portrait of Albertus Seba, a 18th-century Dutch pharmacist.
			
			p Seba was a collector of zoological and other natural subjects and editor of a illustrated work of reference about his collection.
			p He accumulated one of the largest cabinets of curiosities in the Netherlands during his time. He sold one of his cabinets in 1717 to Peter the Great of Russia. His later collections were auctioned after his death. 
			p His early work on taxonomy and natural history influenced Swedish botanist, physician, and zoologist Carl Linnaeus.

	.o-grid__area-04.o-content
		p Born in Etzel, Seba moved to Amsterdam as an apprentice and, around 1700, opened a pharmacy near the harbour. Seba asked sailors and ship surgeons to bring exotic plants and animal products he could use for preparing drugs. Seba also started to collect snakes, birds, insects, shells and lizards in his house.
		p 
			| In October 1728 Seba had become a Fellow of the Royal Society. In 1734, he had published a Thesaurus of animal specimens with beautiful engravings. The full name of the Thesaurus is, with a dual Latin–Dutch title, 
			em Locupletissimi rerum naturalium thesauri accurata descriptio
			|  (Accurate description of the very rich thesaurus of the principal and rarest natural objects).
		p Today, the original 446-plate volume is on permanent exhibit at the Koninklijke Bibliotheek in The Hague, Netherlands.
		p 
			| Seba's inclusion of fantastic beasts such as the hydra influenced Linnaeus to include the “Paradoxa,” species which may exist but which have not been found, in his 
			em Systema Naturae.
		p 
			| Seba is commemorated in the scientific names of two species and one subspecies of snakes:
			em  Ninia sebae, Python sebae, 
			| and 
			em Oxyrhopus petola sebae.
	
	figure.o-grid__area-05.o-media
		img.o-media__img(
src='https://upload.wikimedia.org/wikipedia/commons/thumb/7/70/Albertus_Seba_-_Hydra.jpg/1920px-Albertus_Seba_-_Hydra.jpg'
alt='The Hamburg Hydra, from the Thesaurus (1734)'
)
		figcaption.o-media__legend ↑ The Hamburg Hydra, from the Thesaurus (1734).
	
	footer.o-grid__area-06.o-footer
		p 
			small Content adapted from Wikipedia, including text and images: https://en.wikipedia.org/wiki/Albertus_Seba
              
            
!

CSS

              
                $dev_sm_max: 32.438rem;
$dev_sm_min: 32.5rem;
$dev_md_min: 40.625rem;
$dev_lg_min: 53.125rem;

:root {
	// COLOR CSS VARIABLES 
	--color_base: #FFF; // White 
	--color_mag: #FFCDD2; // Pink
	--color_ink: #282724; // Black
	--color_highlight: #FFFF00; // Yellow
	
	// SIZE VARIABLES	
	--magazine: 56rem;
	--mag_col: 12rem;
	--gap: 1.25rem;
	--gap_half: calc(var(--gap) / 2);
	--border_sm: 1px;
	--border_md: 3px;
	
	@media screen and (min-width: $dev_sm_min) {
		--gap: calc(var(--magazine) / 24);
	}
}

// LAYOUT
body {
	min-width: 20rem;
	background-color: var(--color_base);
	color: var(--color_ink);
	font-family: 'Aleo', serif;
	margin: 0;
}

figure,
figcaption {
	margin: 0;
}

p {
	font-size: 0.9rem;
	line-height: 1.7;
	margin-top: 0; // Align <p> at the top if 'columns' property is been used on parent container.
	text-align: justify;
	
	@media screen and (min-width: $dev_md_min) {
		font-size: 0.8rem;
	}
	
	&:last-child {
		margin: 0;
	}
}

::selection {
	background-color: var(--color_highlight);
}

// UTILITY
.u-txt-center {
	text-align: center;
}

// COMPONENTS 
.c-heading {
	font-weight: normal;
	margin: 0;
	
	&:not(.c-heading--03) {
		text-transform: uppercase;
	}
	
	&--01,
	&--03,
	&--05 {
		font-family: 'Sree Krushnadevaraya', serif;
	}
	
	&--02,
	&--04 {
		font-family: 'Open Sans', sans-serif;
		letter-spacing: 0.2rem;
	}
	
	&--01 {
		font-size: 5.5rem;
		line-height: 1.1;
		margin-top: -1.8rem;
		
		@media screen and (min-width: $dev_sm_min) {
			font-size: 7rem;
		}
		
		@media screen and (min-width: $dev_md_min) {
			font-size: 9rem;
			margin-top: -3rem;
		}
	}
	
	&--02 {
		font-size: 1rem;
		line-height: 1.7;
	}
	
	&--03 {
		font-size: 1.5rem;
		line-height: 1.2;
		margin-top: calc(var(--gap_half) / -2);
		margin-bottom: calc(var(--gap_half) / 2);
		padding-bottom: 1rem;
		
		@media screen and (min-width: $dev_sm_min) {
			font-size: 1.7rem;
			padding-right: 1rem;
			padding-left: 1rem;
		}
		
		@media screen and (min-width: $dev_lg_min) {
			font-size: 2.2rem;
		}
	}
	
	&--04 {
		border-top: var(--border_sm) solid var(--color_ink);
		border-bottom: var(--border_sm) solid var(--color_ink);
		font-size: 0.8rem;
		font-weight: bold;
		line-height: 1.3;
		padding: 0.3rem 0;
			
		@media screen and (min-width: $dev_sm_min) {
			font-size: 0.9rem;
		}
	}
	
	&--05 {
		font-size: 1.2rem;
		line-height: 1;
	}
}

// OBJECTS
.o-grid {
	--minmax: var(--mag_col);
	
	max-width: var(--magazine);
	background-color: var(--color_mag);
	border-left: var(--border_sm) solid var(--color_ink);
	border-right: var(--border_sm) solid var(--color_ink);
	
	display: grid;
	grid-template: auto / var(--gap) repeat(2, 1fr) minmax(var(--minmax), 1fr) var(--gap);
	grid-template-areas: 
    	". header header header ."
		". subheader subheader subheader ."
    	". profile profile profile ."
    	". content content content ."
		". work-sample work-sample work-sample ."
		". footer footer footer .";
	grid-column-gap: var(--gap);
	grid-row-gap: var(--gap_half);
	
	margin: 0 auto;
	padding-top: var(--gap);

	@media screen and (min-width: $dev_md_min) {
		--minmax: 15rem;
		
		grid-template-areas: 
			". header header header ."
			". subheader subheader subheader ."
			". content content profile ."
			". work-sample work-sample profile ."
			". footer footer footer .";
	}
		
	&__area {
		&-01 {
			grid-area: header;
		}
		
		&-02 {
			grid-area: subheader;
		}
		
		&-03 {
			grid-area: profile;
		}
		
		&-04 {
			grid-area: content;
		}
		
		&-05 {
			grid-area: work-sample;
		}		
		
		&-06 {
			grid-area: footer;
		}
	}
}

.o-header {				
	border-top: var(--border_md) solid var(--color_ink);
	border-bottom: var(--border_md) solid var(--color_ink);
	padding: calc(var(--gap_half) / 4) 0;
	position: relative;

	// Second top border
	&:before {
		width: 100%;
		content: '';
		border-top: var(--border_sm) solid var(--color_ink);
		position: absolute;
		top: var(--border_md);
		left: 0;
	}
}

.o-profile {	
	position: relative;

	@media screen and (max-width: $dev_sm_max) {
		margin-bottom: var(--gap_half);
	}
	
	// Bottom-lined background
	&:after {
		width: 100%;
		height: 100%;
		background-color: var(--color_base);
		background-image: url("data:image/svg+xml,%3Csvg width='6' height='6' viewBox='0 0 6 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23282724' fill-opacity='1' fill-rule='evenodd'%3E%3Cpath d='M5 0h1L0 6V5zM6 5v1H5z'/%3E%3C/g%3E%3C/svg%3E");
		content: '';
		position: absolute;
		bottom: 0;
		left: 0;
		z-index: 0;
	}
	
	&__inner {
		background-color: var(--color_base);
		border-bottom: var(--border_md) solid var(--color_ink);
		padding: var(--gap);
		position: relative;
		z-index: 10;
			
		@media screen and (min-width: $dev_md_min) {
			padding: var(--gap_half);
		}
	}
}

.o-media {
	background-color: var(--color_base);
	
	&__img {
		width: 100%;
	}
	
	&__caption {
		font-family: 'Open Sans', sans-serif;
		font-size: 1.2rem;
		line-height: 1.5;
		margin-bottom: var(--gap);
		
		@media screen and (min-width: $dev_sm_min) {
			margin-bottom: var(--gap_half);
		}
		
		@media screen and (min-width: $dev_md_min) {
			font-size: 1rem;
		}
	}
	
	&__legend {
		border-bottom: var(--border_sm) solid var(--color_ink);
		font-family: 'Open Sans', sans-serif;
		font-size: 0.8rem;
		line-height: 1.5;
		padding: 0 var(--gap_half) 0.3rem;
	}
}

.o-content {		
	columns: var(--mag_col);
	column-gap: var(--gap);
}

.o-footer {
	margin: var(--gap_half) 0;
	
	p {
		line-height: 1.3;
		opacity: 0.2;
		word-break: break-all;
	}
}
              
            
!

JS

              
                /* 
 * PURE CSS MAGAZINE GRID LAYOUT VOL. II
 * Responsive grid layout for #CodePenChallenge Stellar Scientists. 
 * A tribute to Albertus Seba.
 * CSS Grid + CSS Columns.
 *
 * Design fully inspired by a real magazine.
 * By ilithya | 2019
 */
              
            
!
999px

Console