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.
<link href="https://fonts.googleapis.com/css?family=Gloria+Hallelujah|Roboto&display=swap" rel="stylesheet"><div class="fichevulcain">
<h1>Un titre ici, qui peut être long, genre 3 lignes</h1>
<h2>Avec Hidoï crachant la Lave</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque nisl risus, posuere a condimentum id, consectetur id enim. Nulla facilisi. Integer a urna pellentesque, vulputate purus a, luctus lectus. Praesent dictum nibh a ex sollicitudin, in pharetra sapien congue. Aenean libero nulla, porta eu aliquet at, suscipit vitae arcu. Quisque euismod, lectus vel rhoncus faucibus, neque arcu venenatis enim, non hendrerit eros tellus vel felis. Quisque molestie cursus neque vitae pulvinar. Pellentesque dui dolor, tincidunt imperdiet arcu eu, molestie cursus tortor.<br /><br />Mauris nibh ligula, dapibus id mauris sed, rutrum accumsan tortor. Suspendisse elit quam, mollis eget tellus sed, dignissim lobortis nibh. Suspendisse potenti. Cras et scelerisque purus. Nulla facilisi. Sed posuere sapien vel est rutrum dapibus. Morbi sed justo vitae libero convallis maximus nec eget massa. Phasellus ac mi nec sapien egestas dignissim ut vitae velit. Cras vulputate purus nulla, eget hendrerit lorem fermentum eget. Cras vehicula volutpat nibh, quis sollicitudin odio varius eu. Nulla hendrerit, ante quis maximus dictum, ante urna suscipit tortor, ut porttitor enim justo in purus.<br /><br />Donec fermentum, sem vel gravida sollicitudin, ante ipsum eleifend mi, vel molestie nulla est eget sem. Mauris lectus lectus, consectetur eget nunc eu, malesuada iaculis sem. Cras hendrerit velit sit amet sem accumsan egestas. Vivamus sapien enim, interdum tempor dapibus et, facilisis ut quam. Pellentesque at metus sed dui maximus placerat eleifend in magna. Aliquam et leo vitae eros vestibulum auctor vel a nunc. Ut sed accumsan nunc, ac interdum arcu. Aliquam sagittis id ante et convallis. Proin id arcu metus. Praesent molestie, magna sit amet efficitur scelerisque, ipsum mi porta eros, eu facilisis lacus nulla ullamcorper erat.</p>
</div>
*{box-sizing: border-box;}
.fichevulcain{
width: 480px;
border-top: 20px solid #000;
border-bottom: 20px solid #000;
margin: auto;
background-image: url(https://zupimages.net/up/19/26/2puc.jpg);
background-size: 480px;
background-repeat: no-repeat;
}
.fichevulcain *{
margin: 0 auto;
}
.fichevulcain h1{
width: 300px;
float: left;
margin: 85px 0px 0px 20px;
position: relative;
z-index: 1;
color: #fefefe;
font: 25px Gloria Hallelujah;
line-height: 35px;
text-shadow: 2px 2px 0px #BD561C;
}
.fichevulcain h1:after{
content: '';
display: block;
margin: auto;
width: 120px;
height: 2px;
background: #FC891E;
box-shadow: 2px 2px 0px #BD561C;
}
.fichevulcain h2{
position: relative;
z-index: 1;
width: 245px;
height: 30px;
margin: 260px auto -10px;
background: #FC891E;
box-shadow: 2px 2px 0px #BD561C;
padding: 3px 10px;
color: #fefefe;
font: 16px Gloria Hallelujah;
line-height: 26px;
text-shadow: 2px 2px 0px #BD561C;
text-align: center;
}
.fichevulcain p{
background: #fefefe;
padding: 25px 20px 15px 20px;
text-align: justify;
font: 12px Roboto;
}
Also see: Tab Triggers