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.
<p>Atqui clita prompta eum an, an mundi nusquam sit. Movet consequat sit eu, ne pri equidem pericula principes, in vim etiam audiam. Qui ne munere mandamus expetenda. Saperet gloriatur vel ea, an sit quas aliquam lobortis. Lorem referrentur definitionem id mel, mel augue luptatum complectitur at. Erant suavitate vel ut.
<blockquote class="pullquote">
The concept of generated content can be slippery to grasp, primarily because it may be considered outside the central purpose of <br>CSS.
</blockquote>
<p>At ius nobis omittantur, ei sed homero efficiantur contentiones, per harum discere et. Sonet molestie te nec, reque homero tamquam id vix, erat volumus ea eam. Et sumo reprehendunt eum, eam in latine eripuit, essent habemus et nam. Vim sumo case ea. Probo elitr ceteros at qui. An sit natum epicurei, vis mucius utroque splendide at, dicta bonorum persecuti eam ad. Et mea eruditi indoctum iudicabit, cu vero omittam concludaturque pro, alienum invidunt tacimates ex usu.
<p>Persius blandit adipisci mei cu, qui ea alia solum putent. Te delectus conceptam mel, et eius veniam mea. Id mei quas idque tation, pro eu tamquam vocibus. Te omnis dolor consul his, et exerci consul vivendo ius, ex habeo voluptatum duo. Est id scaevola mediocrem, pro ea amet libris altera.
<p>Ad duo veritus signiferumque. Nec ut laudem admodum. Nonumes constituto reprehendunt pri ea, mei simul affert id. Id duo omittam definitiones, qui periculis contentiones ei. Eum nemore disputationi voluptatibus ex, pro dolore dolores periculis ut.
<p>Putant offendit invidunt an his, atqui periculis cum et. Eros phaedrum pertinax cu sed, in vim fastidii percipit. Noster gloriatur reprehendunt has et. Et his latine scripta postulant, vix eu velit dolorum, sed salutandi iudicabit te. In nam malis nemore latine.
@import url(https://fonts.googleapis.com/css?family=Questrial);
body {
margin: 3rem;
font-family: Georgia, serif;
font-size: 1.4rem;
line-height: 1.5;
}
.pullquote {
padding: 2.6rem 2.2rem 2rem 3.6rem;
width: 20rem;
position: relative;
margin: 0 2rem 2rem 0;
float: left;
font-family: Questrial, Helvetica, sans-serif;
font-size: 1.8rem;
line-height: 1.4;
-webkit-font-smoothing: antialiased;
color: #FFF;
text-transform: uppercase;
background: #2F2F2F;
border: 1px solid #eee;
box-shadow: 0 0 5px #2F2F2F
}
.pullquote br { display: none; }
.pullquote:before, .pullquote:after {
content: "“";
font-family: Georgia;
font-size: 400%;
position: absolute;
color: yellow;
text-shadow: 0 0 5px rgba(0,0,0,0.4);
}
.pullquote:before {
top: .25rem;
left: .5rem;
}
.pullquote:after {
content: "”";
bottom: -3rem;
right: 3rem;
}
@media screen and (max-width: 700px)
{
.pullquote {
float: none;
width: 80%;
margin: 0 auto;
}
.pullquote br { display: block; }
}
@media screen and (max-width: 550px) {
.pullquote br { display: none; }
}
@media screen and (max-width: 480px) {
.pullquote:before, .pullquote:after { font-size: 200%; }
.pullquote {
font-size: 1.4rem;
padding: 1.6rem 1.2rem 1rem 2rem;
}
.pullquote:after { bottom: 0; }
}
Also see: Tab Triggers