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="section-one">
<h2 class="section-one__title">Awesome Section - 1</h2>
<p class="section-one__descr">Not far stuff she think the jokes. Going as by do known noise he wrote round leave. Warmly put branch people narrow see. Winding its waiting yet parlors married own feeling. Marry fruit do spite jokes an times. Whether at it unknown warrant herself
winding if. Him same none name sake had post love. An busy feel form hand am up help. Parties it brother amongst an fortune of. Twenty behind wicket why age now itself ten.</p>
<!-- begin Separator -->
<div class="separator">
<svg class="separator__svg" width="100%" height="400" viewBox="0 0 100 100" preserveAspectRatio="none" fill="#44A36F" version="1.1" xmlns="http://www.w3.org/2000/svg">
<path d="M 100 100 V 10 L 0 100"/>
<path d="M 30 73 L 100 18 V 10 Z" fill="#308355" stroke-width="0"/>
</svg>
</div>
<!-- end Separator -->
</div>
<div class="section-two">
<h2 class="section-two__title">Awesome Section - 2</h2>
<p class="section-two__descr">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>
</div>
body {
overflow-x: hidden;
}
.section-one {
background-color: #5FC18B;
position: relative;
padding: 200px 0 350px;
.section-one__title {
color: #fff;
font-size: 35px;
margin-bottom: 30px;
text-align: center;
}
.section-one__descr {
color: #fff;
font-size: 16px;
line-height: 1.5;
max-width: 300px;
margin: 0 auto;
text-align: center;
}
}
.section-two {
background-color: #44a36f;
padding: 100px 0 200px;
position: relative;
z-index: 10;
.section-two__title {
color: #fff;
font-size: 35px;
margin-bottom: 30px;
text-align: center;
}
.section-two__descr {
color: #fff;
font-size: 16px;
line-height: 1.5;
max-width: 300px;
margin: 0 auto;
text-align: center;
}
}
/* -------------------------------------------------------------------------
begin Separator
* ------------------------------------------------------------------------- */
.separator {
bottom: -4px;
left: 0;
overflow: hidden;
position: absolute;
width: 100%;
}
/* -------------------------------------------------------------------------
end Separator
* ------------------------------------------------------------------------- */
/* begin Media Max-Width 767
============================================================================ */
@media screen and (max-width: 767px) {
.section-one {
padding: 130px 0 190px;
}
.separator {
bottom: -110px;
.separator__svg {
left: -20%;
position: relative;
transform: rotate(15deg);
width: 140%;
}
}
}
/* end Media Max-Width 767
============================================================================ */
Also see: Tab Triggers