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.
<div class="wrap">
<header>
<h1 class="article-title">Code <span class="amper">& </span>Design</h1>
<h2 class="author">by Hans Engebretsen</h2>
</header>
<div class="content">
<p>Pitchfork consectetur American Apparel squid selvage, pariatur delectus YOLO post-ironic asymmetrical disrupt irony Austin 3 wolf moon. PBR&B Wes Anderson Intelligentsia Williamsburg, proident food truck master cleanse deserunt irony non ethical in messenger bag distillery. Whatever duis fap four loko XOXO synth, aute kale chips blog ugh aesthetic meh. Ullamco lo-fi vero, kogi organic forage tattooed mixtape pariatur kale chips Pinterest drinking vinegar biodiesel. Anim Tumblr esse YOLO. Sint Pitchfork jean shorts YOLO. Cardigan sed literally trust fund fugiat cliche ea, labore paleo id.</p>
<p>XOXO bicycle rights wayfarers, quinoa mlkshk elit Etsy fap. Sapiente aliqua trust fund PBR&B butcher. Vinyl bespoke consequat banh mi. Tofu polaroid biodiesel nulla, stumptown PBR&B Marfa. Roof party Thundercats sint Marfa 8-bit incididunt. Tote bag consectetur Portland fixie, commodo street art vegan ad officia sunt occupy banjo. Dreamcatcher exercitation asymmetrical enim, bitters nesciunt cillum hella beard deserunt next level assumenda aesthetic.</p>
<p>Salvia locavore wolf Vice, Tonx lomo farm-to-table selfies duis seitan keytar chillwave selvage chambray in. Aliqua laborum hella ad shabby chic quis. Messenger bag bitters magna skateboard 90's. Chia banh mi meh, before they sold out authentic swag forage next level cred lo-fi quinoa you probably haven't heard of them. Next level lomo excepteur Brooklyn, YOLO culpa iPhone fingerstache retro food truck accusamus direct trade roof party. Stumptown id odio, 90's cillum shabby chic Williamsburg dreamcatcher. Assumenda Pinterest wayfarers, odio Shoreditch narwhal aute aliquip biodiesel consectetur meggings Bushwick occaecat reprehenderit High Life.</p>
</div>
</div>
@import "compass/css3";
$black: #494b50;
$grey: #62646a;
$light-grey: rgba($grey, 0.8);
$red: #b52d2e;
$cream: #faf4eb;
$light-red: lighten($red, 40%);
$light-dark-red: darken($red, 13%);
$dark-red: desaturate($red, 13%);
$blue: #1b68b2;
$light-blue: lighten($blue, 40%);
$light-dark-blue: darken($blue, 13%);
$dark-blue: desaturate($blue, 13%);
@import url(https://fonts.googleapis.com/css?family=Arbutus+Slab);
body {
color: $grey;
font-family: 'Arbutus Slab', serif;
background-color: $cream;
}
h1 {
color: $blue;
text-align: center;
font-size: 4.4em;
line-height: .6em;
text-transform: uppercase;
letter-spacing: .01em;
margin-bottom: .2em;
margin-top: 2rem;
padding-bottom: 0;
text-shadow:
0 -2px 0 $light-blue,
0 2px 0 $light-dark-blue,
1px 0px 0 $dark-blue,
3px 3px 0px rgba(0, 0, 0, 0.1),
-3px 4px 0px rgba(0, 0, 0, 0.1),
2px -2px 0px rgba(0, 0, 0, 0.1),
0 1px 3px rgba(0, 0, 0, 0.2),
0 3px 5px rgba(0, 0, 0, 0.2),
0 5px 10px rgba(0, 0, 0, 0.2),
0 10px 10px rgba(0, 0, 0, 0.2),
0 20px 20px rgba(0, 0, 0, 0.1),
-150px 580px 0 rgba($blue, 0.06);
@include rotate(0deg);
span.amper {
display: block;
color: $red;
font-size: 1.1em;
text-shadow:
0 -2px 0 $light-red,
0 2px 0 $light-dark-red,
1px 0px 0 $dark-red,
3px 3px 0px rgba(0, 0, 0, 0.1),
-3px 4px 0px rgba(0, 0, 0, 0.1),
2px -2px 0px rgba(0, 0, 0, 0.1),
0 1px 3px rgba(0, 0, 0, 0.2),
0 3px 5px rgba(0, 0, 0, 0.2),
0 5px 10px rgba(0, 0, 0, 0.2),
0 10px 10px rgba(0, 0, 0, 0.2),
0 20px 20px rgba(0, 0, 0, 0.1),
-150px 580px 0 rgba($red, 0.06);
}
}
.author {
font-family: caslon, 'adobe Caslon pro', garamond, 'adobe garamond', serif;
font-style: italic;
font-size: 1.25em;
color: $black;
text-align: center;
margin-bottom: 1.5rem;
}
.wrap {
width: 500px;
margin: 0 auto;
}
header {
margin-top: 10%;
&:after {
content: "";
width: 20%;
height: 4px;
display: block;
background-color: $light-grey;
margin: 0 auto;
@include border-radius(4px);
}
&:before {
@extend header:after;
}
}
.content {
margin-top: 2.5rem;
}
p {
margin-top: .4em;
font-size: .78em;
}
Also see: Tab Triggers