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 esm.sh, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ESM 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.
<div class="container">
<header class="info">
<h2>The art of patterns at fronteers conf</h2>
<section class="meta">
<span>by</span> <img src="https://d13yacurqjgara.cloudfront.net/users/135409/avatars/small/R55A0071.png" /> <a href="#">Koen Vendrik</a>
</section>
<img src="https://www.bitstorm.org/weblog/2010-10/fronteers2010~head.jpg" />
</header>
<p class='intro'>Had repulsive dashwoods suspicion sincerity but advantage now him. Remark easily garret nor nay. Civil those mrs enjoy shy fat merry. You greatest jointure saw horrible. He private he on be imagine suppose. Fertile beloved evident through no service elderly is.</p>
<p>Difficulty on insensible reasonable in. From as went he they. Preference themselves me as thoroughly partiality considered on in estimating. Middletons acceptance discovered projecting so is so or. In or attachment inquietude remarkably comparison at an.</p>
<blockquote>Is surrounded prosperous stimulated am me discretion expression. But truth being state can she china widow. Occasional preference fat remarkably now projecting uncommonly dissimilar.</blockquote>
<p>Sentiments projection particular companions interested do at my delightful. Listening newspaper in advantage frankness to concluded unwilling.</p>
<p>Remain lively hardly needed at do by. Two you fat downs fanny three. True mr gone most at. Dare as name just when with it body. Travelling inquietude she increasing off impossible the. Cottage be noisier looking to we promise on. Disposal to kindness appetite diverted learning of on raptures. Betrayed any may returned now dashwood formerly. Balls way delay shy boy man views. No so instrument discretion unsatiable to in.</p>
<img src="https://d262ilb51hltx0.cloudfront.net/fit/t/1600/1280/gradv/29/81/55/1*qUF3hZQFAFtqyYO1pRS0Tw.png" />
<span>Lights (source: medium.com)</span>
<p>Rank tall boy man them over post now. Off into she bed long fat room. Recommend existence curiosity perfectly favourite get eat she why daughters. Not may too nay busy last song must sell. An newspaper assurance discourse ye certainly. Soon gone game and why many calm have.</p>
<p>Yet bed any for travelling assistance indulgence unpleasing. Not thoughts all exercise blessing. Indulgence way everything joy alteration boisterous the attachment. Party we years to order allow asked of. We so opinion friends me message as delight. Whole front do of plate heard oh ought. His defective nor convinced residence own. Connection has put impossible own apartments boisterous. At jointure ladyship an insisted so humanity he. Friendly bachelor entrance to on by.</p>
<pre><code class='language-javascript'>var getFeedback = function(){
return console.log('prismjs is awesome, thanks Lea!');
}();</code></pre>
<p>Attended no do thoughts me on dissuade scarcely. Own are pretty spring suffer old denote his. By proposal speedily mr striking am. But attention sex questions applauded how happiness. To travelling occasional at oh sympathize prosperous. His merit end means widow songs linen known. Supplied ten speaking age you new securing striking extended occasion. Sang put paid away joy into six her.</p>
<p>It real sent your at. Amounted all shy set why followed declared. Repeated of endeavor mr position kindness offering ignorant so up. Simplicity are melancholy preference considered saw companions. Disposal on outweigh do speedily in on. Him ham although thoughts entirely drawings. Acceptance unreserved old admiration projection nay yet him. Lasted am so before on esteem vanity oh.</p>
<p>From they fine john he give of rich he. They age and draw mrs like. Improving end distrusts may instantly was household applauded incommode. Why kept very ever home mrs. Considered sympathize ten uncommonly occasional assistance sufficient not. Letter of on become he tended active enable to. Vicinity relation sensible sociable surprise screened no up as.</p>
<p>She travelling acceptance men unpleasant her especially entreaties law. Law forth but end any arise chief arose. Old her say learn these large. Joy fond many ham high seen this. Few preferred continual sir led incommode neglected. Discovered too old insensible collecting unpleasant but invitation.</p>
<a class='btn'>View Project</a>
<footer class="navigation">
<header>
<h6 class='small'>Next Post</h6>
<span class="ss-icon ss-standard">rows</span>
</header>
<a href="#">
<h4>Where do patterns come from? Space? Mars Perhaps?</h4>
</a>
<section class="meta">
<span>by</span> <img src="https://pbs.twimg.com/profile_images/458618257432252417/dtAIMOnK.jpeg" /> <a href="#">Bas Kaal</a> + <img src="https://pbs.twimg.com/profile_images/434110818033364992/wVqsMmvS.jpeg" /> <a href="#">Jeroen Baars</a>
</section>
</footer>
</div>
$base-color: #444;
$white: #fff;
$grey-1: #888;
$accent: #1f8a70;
$accent-dark: darken($accent,2%);
$accent-light: lighten($accent,2%);
$border-size: 3px;
$border-size-alt: 1px;
$border-radius: 5px;
$border-radius-alt: 2px;
$size-l: 1.2em;
$size-m: 16px;
$size-s: .9em;
$margin-xxs: 5px;
$margin-xs: 10px;
$margin-s: 20px;
$margin-m: 40px;
$margin-xl: 80px;
$padding-s: 5px 15px;
$padding-m: 20px 25px;
* {
line-height: 1.8;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
html,body {
margin: 0;
padding: 0;
}
body {
font: 300 $size-m 'Open Sans';
color: $base-color;
}
.container {
width: 600px;
margin: $margin-xl auto 0 auto;
}
h1,h2,h3,h4,h5,h6,p,blockquote,ul,ol {
margin: 0;
margin-bottom: $margin-m;
}
p {
&.intro {
font-size: $size-l;
font-weight: 500;
color: $accent;
}
}
a {
text-decoration: none;
color: $accent;
&:hover {
border-bottom: solid $border-size-alt $accent;
}
&.btn {
font-size: $size-s;
color: #fff;
display: inline-block;
padding: $padding-s;
border: solid $border-size-alt $accent-dark;
border-radius: $border-radius-alt;
background-image: -webkit-linear-gradient(bottom, $accent 0%, $accent-light 100%);
cursor: pointer;
&:hover {
background: $accent;
}
}
}
blockquote {
color: $accent;
font-style: italic;
font-size: $size-l;
}
h1,h2,h3,h4,h5,h6 {
font-weight: 900;
text-transform: uppercase;
line-height: 1.3;
color: $accent;
}
h1 {
font-size: 3em;
}
h2 {
font-size: 2.4em;
}
h3 {
font-size: 2.2em;
}
h4 {
font-size: 1.8em;
}
h5 {
font-size: 1.4em;
}
h6 {
font-size: 1.4em;
&.small {
font-size: $size-m;
font-weight: 300;
margin-bottom: $margin-s;
}
}
header.info {
overflow: hidden;
border-bottom: solid $border-size $accent;
margin-bottom: $margin-s;
line-height: 0;
h2 {
font-size: 4em;
line-height: 1.1em;
color: transparent;
background-image: url(http://media-cache-ak0.pinimg.com/236x/79/e8/db/79e8dbe5b67d36cc7f8c1f80167f8bb8.jpg);
-webkit-background-clip: text;
background-clip: text;
}
img {
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}
}
section.meta {
margin-bottom: $margin-m;
span {
color: $grey-1;
}
a {
margin-right: $margin-xxs;
}
img {
width: 40px;
border-radius: 100%;
display: inline-block;
position: relative;
top: 12px;
margin: 0 $margin-xxs 0 $margin-xs;
}
}
img {
width: 100%;
border-radius: $border-radius;
& + span {
color: $grey-1;
font-size: $size-s;
margin-bottom: $margin-m;
display: block;
}
}
pre {
border-radius: $border-radius;
margin-bottom: $margin-m !important;
overflow: hidden;
padding: $padding-m !important;
}
footer.navigation {
width: 100%;
padding: $padding-m;
margin-top: $margin-m;
border-top: solid $border-size $accent;
background: $white;
-webkit-transition: .3s;
position: relative;
z-index: 1;
header{
width: 100%;
overflow: hidden;
margin-bottom: $margin-s;
h6 {
margin: 0;
float: left;
}
span.ss-icon {
display: block;
float: right;
margin-top: -4px;
color: $accent;
}
}
h4 {
color: transparent;
background-image: url(http://media-cache-ak0.pinimg.com/236x/ac/2f/cf/ac2fcfad5efdd3c7d27c9c85a18c56c4.jpg);
-webkit-background-clip: text;
background-clip: text;
margin-bottom: $margin-xs;
-webkit-animation: 8s movebg infinite alternate;
-webkit-animation-timing-function: ease;
-webkit-animation-play-state: paused;
}
.meta {
font-size: $size-s;
a:hover {
border-bottom: none;
}
img {
width: 30px;
top: 9px;
}
}
&:hover {
margin-top: -$margin-m;
h4 {
-webkit-animation-play-state: running;
}
}
}
@-webkit-keyframes movebg {
to {
background-position: right;
}
}
Also see: Tab Triggers