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="scroll_container">
<div class="scroll_content">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Augue eget arcu dictum varius. Sed id semper risus in hendrerit gravida. Eget est lorem ipsum dolor sit. Dui accumsan sit amet nulla. Vestibulum sed arcu non odio euismod lacinia at quis. Integer feugiat scelerisque varius morbi enim nunc faucibus a. Ut sem viverra aliquet eget sit amet tellus cras adipiscing. Vitae proin sagittis nisl rhoncus mattis rhoncus urna. Amet commodo nulla facilisi nullam.</p>
<p>Morbi non arcu risus quis varius quam quisque id diam. Dui nunc mattis enim ut tellus elementum sagittis. Vitae et leo duis ut diam quam nulla porttitor massa. Amet aliquam id diam maecenas ultricies. Magna sit amet purus gravida quis blandit turpis. Sagittis purus sit amet volutpat consequat mauris nunc. Curabitur vitae nunc sed velit dignissim sodales ut eu. Cras adipiscing enim eu turpis egestas pretium. Faucibus purus in massa tempor nec feugiat nisl pretium. Ut morbi tincidunt augue interdum velit. Pellentesque habitant morbi tristique senectus et netus. Vitae congue eu consequat ac felis donec et odio pellentesque. Urna nunc id cursus metus aliquam eleifend mi. Elit ullamcorper dignissim cras tincidunt. Tortor id aliquet lectus proin nibh nisl.</p>
<p>Augue interdum velit euismod in pellentesque massa placerat. At elementum eu facilisis sed odio morbi quis. Sed libero enim sed faucibus turpis. In fermentum et sollicitudin ac orci phasellus egestas tellus rutrum. Congue quisque egestas diam in arcu cursus euismod. Egestas integer eget aliquet nibh praesent tristique magna sit. Proin nibh nisl condimentum id venenatis a condimentum. Et ultrices neque ornare aenean euismod elementum nisi quis eleifend. Mauris in aliquam sem fringilla ut morbi. Posuere sollicitudin aliquam ultrices sagittis. Pulvinar neque laoreet suspendisse interdum.</p>
<p>Ultrices eros in cursus turpis massa. Neque laoreet suspendisse interdum consectetur libero id. Lacinia at quis risus sed vulputate. Augue interdum velit euismod in. Neque egestas congue quisque egestas diam in. Natoque penatibus et magnis dis. Justo laoreet sit amet cursus sit amet dictum sit amet. Sapien pellentesque habitant morbi tristique senectus et. Donec ultrices tincidunt arcu non sodales neque sodales. Pellentesque elit eget gravida cum sociis natoque penatibus et magnis. Semper feugiat nibh sed pulvinar proin gravida hendrerit lectus. Euismod nisi porta lorem mollis aliquam ut. Sed velit dignissim sodales ut eu sem integer. Id consectetur purus ut faucibus pulvinar elementum integer enim. Adipiscing enim eu turpis egestas. Hendrerit dolor magna eget est lorem ipsum dolor sit.</p>
<p>Feugiat nibh sed pulvinar proin. Bibendum enim facilisis gravida neque. Amet nisl purus in mollis nunc sed id semper risus. Orci phasellus egestas tellus rutrum. Consequat mauris nunc congue nisi vitae. Egestas dui id ornare arcu. Turpis in eu mi bibendum neque. Congue mauris rhoncus aenean vel. Ut tortor pretium viverra suspendisse potenti nullam ac. Volutpat blandit aliquam etiam erat. Quis imperdiet massa tincidunt nunc pulvinar sapien. Eu nisl nunc mi ipsum. Aliquam sem et tortor consequat id porta nibh venenatis. Eget velit aliquet sagittis id consectetur purus ut faucibus pulvinar. Commodo sed egestas egestas fringilla phasellus faucibus scelerisque. Praesent tristique magna sit amet purus gravida quis blandit. Malesuada pellentesque elit eget gravida cum. Mollis aliquam ut porttitor leo a diam sollicitudin tempor id. Facilisis gravida neque convallis a cras semper auctor neque.</p>
<p>Massa vitae tortor condimentum lacinia quis. Cursus metus aliquam eleifend mi. Sapien nec sagittis aliquam malesuada bibendum arcu vitae elementum curabitur. Amet consectetur adipiscing elit pellentesque habitant morbi. Laoreet id donec ultrices tincidunt. Morbi tincidunt ornare massa eget egestas purus. Porttitor massa id neque aliquam vestibulum morbi blandit cursus risus. Odio pellentesque diam volutpat commodo sed egestas egestas. Velit sed ullamcorper morbi tincidunt ornare. Volutpat commodo sed egestas egestas fringilla phasellus. Amet nisl purus in mollis nunc. Id porta nibh venenatis cras sed felis eget velit aliquet. Tempor orci dapibus ultrices in iaculis nunc. Elit at imperdiet dui accumsan sit. Viverra nibh cras pulvinar mattis nunc sed blandit libero. Vitae aliquet nec ullamcorper sit amet risus nullam eget felis. Sit amet est placerat in egestas erat.</p>
<p>Eget sit amet tellus cras adipiscing. Nibh venenatis cras sed felis eget velit aliquet sagittis. Nulla facilisi nullam vehicula ipsum a arcu cursus vitae. Eget gravida cum sociis natoque penatibus et. Odio facilisis mauris sit amet massa. Nisl suscipit adipiscing bibendum est ultricies integer quis. Mauris cursus mattis molestie a. Laoreet id donec ultrices tincidunt arcu non sodales neque. Viverra adipiscing at in tellus integer feugiat scelerisque. Libero enim sed faucibus turpis. Tristique magna sit amet purus gravida quis blandit turpis. Quis eleifend quam adipiscing vitae. Laoreet non curabitur gravida arcu ac tortor dignissim convallis aenean.</p>
</div>
</div>
<div class="top_bottom_mask" style="right:7px; top:10px;">
<div class="corner_top_mask"></div>
</div>
<div class="left_right_mask" style="right:7px; top:11px; height:417px;"></div>
<div class="left_right_mask" style="right:22px; top:10px; height:418px;"></div>
<div class="top_bottom_mask" style="right:7px; top:420px;">
<div class="corner_bottom_mask"></div>
</div>
.scroll_container {
background-color:#000000;
width:100%;
height:420px;
color:#999999;
border:2px solid #000000;
border-radius:10px;
overflow:hidden;
text-align:justify;
}
.scroll_content {
position:relative;
width:98.4%;
height:414px;
top:-17px;
padding:20px 10px 20px 10px;
overflow-y:auto;
}
.top_bottom_mask {
position:absolute;
overflow:hidden;
width:17px;
height:10px;
}
.left_right_mask {
position:absolute;
width:0px;
border:1px solid #000000;
}
.corner_top_mask, .corner_bottom_mask {
position:relative;
left:-2px;
border:6px solid #000000;
height:20px;
width:13px;
border-radius:16px;
}
.corner_top_mask {
top:-3px;
left:-4px;
}
.corner_bottom_mask {
top:-18px;
left:-4px;
}
Also see: Tab Triggers