HTML preprocessors can make writing HTML more powerful or convenient. For instance, Markdown is designed to be easier to write and read for text documents and you could write a loop in Pug.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. So you don't have access to higher-up elements like the <html>
tag. If you want to add classes there that can affect the whole document, this is the place to do it.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. If you need things in the <head>
of the document, put that code here.
The resource you are linking to is using the 'http' protocol, which may not work when the browser is using https.
CSS preprocessors help make authoring CSS easier. All of them offer things like variables and mixins to provide convenient abstractions.
It's a common practice to apply CSS to a page that styles elements such that they are consistent across all browsers. We offer two of the most popular choices: normalize.css and a reset. Or, choose Neither and nothing will be applied.
To get the best cross-browser support, it is a common practice to apply vendor prefixes to CSS properties and values that require them to work. For instance -webkit-
or -moz-
.
We offer two popular choices: Autoprefixer (which processes your CSS server-side) and -prefix-free (which applies prefixes via a script, client-side).
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.
You can apply CSS to your Pen from any stylesheet on the web. Just put a URL to it here and we'll apply it, in the order you have them, before the CSS in the Pen itself.
You can also link to another Pen here (use the .css
URL Extension) and we'll pull the CSS from that Pen and include it. If it's using a matching preprocessor, use the appropriate URL Extension and we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
JavaScript preprocessors can help make authoring JavaScript easier and more convenient.
Babel includes JSX processing.
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.
You can apply a script from anywhere on the web to your Pen. Just put a URL to it here and we'll add it, in the order you have them, before the JavaScript in the Pen itself.
If the script you link to has the file extension of a preprocessor, we'll attempt to process it before applying.
You can also link to another Pen here, and we'll pull the JavaScript from that Pen and include it. If it's using a matching preprocessor, we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
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.
Using packages here is powered by Skypack, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ES6 import
usage.
All packages are different, so refer to their docs for how they work.
If you're using React / ReactDOM, make sure to turn on Babel for the JSX processing.
If active, Pens will autosave every 30 seconds after being saved once.
If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.
If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.
Visit your global Editor Settings.
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
$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;
}
}
/*
* 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
*/
Also see: Tab Triggers