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.
article
.hero
.content
h1 The Long Road Home
.content__header
h2 A fighting spirit and a passion for hockey are in the blood of courageous North Dakota Senior
span By Jess Myers
.content__copy
p Blood. It's where a passion for University of North Dakota hockey lives in Lisa Marvin. Skating for the team now known as the Fighting Hawks isn't just something she does while pursuing her communications degree. It's ingrained her DNA.
p Her older sister Layla played four seasons at North Dakota, and was the team capatain last year. Their father spent four seasons manning the blue line for the team then known as the Fighting Sioux. So did a trio of uncles and cousins. Her grandfather, Cal Marvin, started the school's hockey program not long after World War II.
p When Lisa committed to play for North Dakota after an amazingly successful youth and high school hockey career in her hometown of Warroad, Minn., it was perhaps the least-surprising recruiting news in the history of college sports. She scored more state tournament points than any Minnesota high school player ever, and notched 94 points as a senior.
p But the transition to college hockey was tough. Lisa had just one goal as a freshman. The following season, she was off to another challenging start, but had a goal to her credit after playing five games.
p Then, on a seemingly normal cold November 2014 afternoon, her truck ran out of gas on the shoulder of a busy street not far from campus. She hiked to a nearby gas station and was filling the truck, sure to be on her way soon. She doesn't remember the rest.
h3 Fateful Day
p Blood. It's one of the first things Layla noticed when she got to the hospital. It was streaked in Lisa's hair, along with pieces of glass. David and Kallie, and their parents were at work in the restaurant and motel they own, 135 miles away, when they got a frantic call from Layla. They called the Grand Forks hospital. Lisa was there, in the emergency room. She was alive and stable, but the parents were advised to get there ASAP.
p A few hours later, they found their youngest daughter covered in blankets. The room smelled of gasoline. Her right arm was a mangled mess, broken in three places, with a three-inch section of bone gone and a hole bigger than a bottle cap, where bone had punctured skin. All of the ligaments in Lisa's right knee were shredded. Nerve damage had curled her right hand and wrist into a paralyzed fist.
p Blood. It's red. The same color as the car that came speeding down the road that day. While Lisa stood by the shoulder, pouring gas into her truck, an 18-year-old driver was racing with a friend in another car. He list control, and slammed into the back of Lisa's truck. Witnesses later recounted to police that the impact sent her body flying through the air.
p The driver was later charged with aggravated reckless driving, and spent several months in jail. Lisa's sentence was considerably lengthier.
$green: #009a49;
body {
margin: 0;
}
article {
display: flex;
}
.hero {
background-image: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/81080/pr-hoodie.jpg');
background-position: center;
background-size: cover;
background-repeat: no-repeat;
background-position: 50% 50%;
width: 52%;
height: 100vh;
clip-path: polygon(0 0, 91% 0, 76% 100%, 0 100%);
-webkit-clip-path: polygon(0 0, 91% 0, 76% 100%, 0 100%);
}
.content {
width: 47%;
&__header {
width: 37%;
padding-right: 3%;
text-align: right;
display: inline-block;
vertical-align: top;
h2 {
font-family: sans-serif;
text-transform: capitalize;
color: #969696;
margin-top: 0;
}
span {
font-family: sans-serif;
}
}
&__copy {
width: 54%;
padding-left: 3%;
padding-right: 3%;
border-left: 1px solid #969696;
box-sizing: border-box;
display: inline-block;
vertical-align: top;
}
}
h1 {
font-family: "bee", sans-serif;
text-transform: uppercase;
font-style: italic;
font-size: 12vw;
margin: 10% auto 5% -30%;
padding-left: 8%;
z-index: 1;
line-height: 1;
position: relative;
align-self: flex-start;
width: 100%;
color: #000;
letter-spacing: 2px;
&:after {
content: '';
display: inline-block;
background-color: #FFF;
width: 100%;
height: 130%;
position: absolute;
left: -7%;
right: 0;
z-index: -1;
top: 50%;
transform: translateY(-50%);
clip-path: polygon(16% 0%, 100% 0, 100% 100%, 8% 100%);
-webkit-clip-path: polygon(16% 0%, 100% 0, 100% 100%, 8% 100%);
}
}
p {
margin-bottom: 0;
margin-top: 0;
text-indent: 1.5em;
font-size: 0.8rem;
&:first-of-type {
text-indent: 0;
}
&:nth-of-type(1) {
&::first-letter {
float: left;
font-size: 9em;
margin: -0.2em 0.04em -0.2em 0;
font-family: "bee", sans-serif;
font-weight: bold;
}
}
}
h3 {
color: $green;
margin-bottom: 0.1rem;
font-family: sans-serif;
& + p {
text-indent: 0;
}
}
Also see: Tab Triggers