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 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.
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 class="post hentry">
<header class="entry-header">
<h1 class="entry-title">Vågtämjaren</h1>
<h2 class="entry-subtitle">Under sju veckor paddlade Julie Jacobson över tusen kilometer längs Norges kust. Som enda sällskap hade on sälar, lunnefåglar - och Nutella …</h2>
<p class="entry-meta">
<strong>Text</strong> Jannie Aquilonius
<strong>Foto</strong> Julie Jacobson & Karin Åmossa
</p>
</header>
<main class="entry-content">
<p><em>Hon hade trott</em> att ensamheten skulle vara jobbigast. Men Julie Jacboson känner sig inte ensam i sin kajak ute på havet.I stället är det vädret som överraskar och blir den största utmaningen, trots att hon noga kollar prognoserna och förhör sig om läget med lokalbefolkningen. Hon paddlar på nätterna efter det är lugnare då. En natt söder om Tromsö ligger havet spegelblankt. Julie är på sitt tokiga humör där hon bara skrattar och fotograferar för allt är så vackert. Så plötsligt drar starka vindar och vågor in, som från ingenstans. <br>
 — Jag hamnar lite i chock och kände "Wow, var kom det ifrån?" Jag kämpade för att ta mig till ett säkert område och pratade stundvid med mig själv, sa att "You got this!", säger Julie som kommer från North Caroline i USA och har norska förfäder.<br>
 Julie gjorde kajakturen som en del av utbildningen Tierra Adventure Academy, där deltagarna under 2015 fick planera och genomföra ett eget äventyr.<br>
 Resan startar i Trondheim och hon paddlar de tre första veckorna tillsammans med sin pojkvän. Sedan fortsätter hon fyra veckor till på egen hand. Julie lär sig snart att handskas med tidvattenströmmar och bedöma vilka väderförhållanden hon klarar av. Hon inser att panik inte hjälper, det är bättre att fokusera på att lära sig hantera havet. Hon fascineras av färgglada moln när solen går ner och njuter av djurlivet med tumlare, sälar och favoritdjuret lunnefåglar.</p>
<p><strong>Det sägs att du levde på Nutella och bacon, var det så?</strong><br>
— Jag åt väldigt mycket Nuetalla och bacon, men inte bara. Jag fiskade mycket, men blev lite trött på det och då åt jag mer korv och bacon. Jag blev nog gladast av bacon och choklad. Det är lyxigt med kajaken, du behöver inte tänka så mycket på vikt.</p>
<p><strong>Äventyret var även att sätt att fira fem år i Skandinavien, hur firade du?</strong><br>
— Min plan var att drick champagne och äta tårta, men jag var trött efter paddling och klättring så det blev fisksoppa och Nutella istället. Men det var en fin dag med en vacker solnedgång. Vädret hjälpte mig att fira.
</p>
<p><strong>Skulle du göra om ditt äventyr?</strong><br>
— Ja, absolut. När jag kom fram till målet, Tromsö, ville jag bara fortsätta. Jag trodde att jag aldrig skulle vilja padla igen efter det här, men det blev tvärtom och nu vill jag göra en ännu längre resa.</p>
</main>
<footer>
<p>Fonts used are Playfair Display, PT Serif and Roboto Condensed.</p>
<p>The article was published in 365 by Naturkompaniet and they hold the copyrights.</p>
</footer>
</article>
/* Mixins */
$small-breakpoint: 640px;
$medium-breakpoint: 768px;
$large-breakpoint: 1024px;
$xlarge-breakpoint: 1600px;
@mixin MQ($canvas) {
@if $canvas == S {
@media only screen and (min-width: $small-breakpoint) { @content; }
}
@else if $canvas == M {
@media only screen and (min-width: $medium-breakpoint) { @content; }
}
@else if $canvas == L {
@media only screen and (min-width: $large-breakpoint) { @content; }
}
@else if $canvas == XL {
@media only screen and (min-width: $xlarge-breakpoint) { @content; }
}
}
@mixin baseline($gridvalue) {
background: linear-gradient(#FFCDD2 1px, transparent 1px);
background-repeat: repeat;
background-position: top left;
background-size: 100% $gridvalue + px;
}
/* Styling */
body {
font-family: 'PT Serif', sans-serif;
font-size: 16px;
color: rgba(0, 0, 0, 0.87);
// Remove comment below to see the basegrid alignment
// @include baseline(8);
}
h1 {
font-family: 'Playfair Display', sans-serif;
font-size: 72px;
margin: 1px 0 0;
}
h2 {
font-weight:400;
font-size: 24px;
line-height:40px;
margin:25px 0 0;
}
p {
font-size: 16px;
line-height: 24px;
}
p > em {
font-family: 'Roboto Condensed', sans-serif;
font-size: 14px;
font-weight: 700;
font-style: normal;
text-transform:uppercase;
}
.post {
padding: 24px;
}
.entry-header {
text-align:center;
@include MQ(S) {
max-width: 640px;
margin:0 auto;
}
@include MQ(M) {
max-width: 768px;
}
@include MQ(L) {
max-width: 1024px;
}
}
.entry-meta {
font-family: 'Roboto Condensed', sans-serif;
text-transform: uppercase;
font-size:14px;
margin-top: 18px;
margin-bottom: 32px;
}
.entry-content {
width: 90%;
margin: 0 auto;
tab-size: 8;
@include MQ(M) {
width: 100%;
max-width: 768px;
column-count: 2;
column-gap: 42px;
page-break-inside: avoid;
break-inside: avoid;
}
@include MQ(L) {
max-width: 1024px;
column-count: 3;
column-gap: 42px;
page-break-inside: avoid;
break-inside: avoid;
}
}
.entry-content p {
margin-top: 0;
margin-bottom: 24px;
}
footer {
margin-top: 39px;
color: #757575;
max-width: 90%;
text-align:center;
@include MQ(S) {
margin-left: auto;
margin-right: auto;
max-width: 600px;
}
}
Also see: Tab Triggers