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 URL's added here will be added as <link>
s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.
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.
If the stylesheet 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 CSS 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.
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.
<div id="popmake-wrap"><div class="pum-content popmake-content">
<h1 style="text-align: center; max-width: 400px; margin-right: auto; margin-left: auto; font-size: 18px;">Please read the following and click the Agree button at the bottom to continue.</h1>
<div class="scrollwrap">
<div class="popupscroll">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Viverra aliquet eget sit amet tellus cras adipiscing enim eu. Morbi blandit cursus risus at ultrices. Placerat in egestas erat imperdiet sed euismod nisi porta lorem. Lectus magna fringilla urna porttitor rhoncus dolor purus non enim. Arcu felis bibendum ut tristique et egestas. Convallis posuere morbi leo urna molestie. Nunc eget lorem dolor sed viverra. Quisque egestas diam in arcu cursus euismod quis viverra nibh. Sagittis orci a scelerisque purus semper. Sed viverra ipsum nunc aliquet bibendum enim facilisis gravida neque. Placerat orci nulla pellentesque dignissim enim sit amet venenatis urna. Adipiscing commodo elit at imperdiet. Amet massa vitae tortor condimentum lacinia quis vel eros donec. Duis at tellus at urna condimentum mattis pellentesque id. In aliquam sem fringilla ut morbi.</p>
<p>Morbi tincidunt augue interdum velit euismod in pellentesque. Tincidunt praesent semper feugiat nibh sed pulvinar. Sit amet consectetur adipiscing elit pellentesque habitant. Donec enim diam vulputate ut. Faucibus pulvinar elementum integer enim. Mattis nunc sed blandit libero volutpat. Erat imperdiet sed euismod nisi porta lorem mollis aliquam ut. Pellentesque elit ullamcorper dignissim cras. Quam pellentesque nec nam aliquam sem et tortor consequat id. Etiam non quam lacus suspendisse faucibus interdum. Aliquam vestibulum morbi blandit cursus risus at. Elit ut aliquam purus sit amet. Tincidunt id aliquet risus feugiat in ante metus dictum. Diam volutpat commodo sed egestas egestas fringilla phasellus faucibus scelerisque. Quis eleifend quam adipiscing vitae proin sagittis nisl rhoncus. Congue eu consequat ac felis donec et odio pellentesque diam.</p>
<p>Massa sed elementum tempus egestas sed sed risus. Dui nunc mattis enim ut tellus elementum sagittis. Sodales ut etiam sit amet nisl purus in mollis nunc. At erat pellentesque adipiscing commodo elit at imperdiet dui accumsan. Ac tincidunt vitae semper quis lectus nulla. Id nibh tortor id aliquet lectus proin. Orci nulla pellentesque dignissim enim. Porttitor eget dolor morbi non arcu risus quis. Euismod nisi porta lorem mollis aliquam ut porttitor leo a. Convallis convallis tellus id interdum velit. Odio euismod lacinia at quis risus sed. Morbi quis commodo odio aenean sed. Odio ut sem nulla pharetra diam sit amet. Egestas pretium aenean pharetra magna ac. Venenatis urna cursus eget nunc scelerisque viverra mauris.</p>
<p>Vel fringilla est ullamcorper eget nulla. Aliquet sagittis id consectetur purus ut faucibus pulvinar elementum integer. Nam at lectus urna duis convallis convallis tellus id. Leo in vitae turpis massa sed elementum. Quis imperdiet massa tincidunt nunc pulvinar sapien. Turpis massa sed elementum tempus egestas sed sed. Elementum facilisis leo vel fringilla est ullamcorper. Praesent tristique magna sit amet purus gravida quis. Id aliquet lectus proin nibh nisl. Ut etiam sit amet nisl purus in mollis nunc. Ut venenatis tellus in metus vulputate eu scelerisque felis. Nullam vehicula ipsum a arcu cursus vitae congue mauris rhoncus. Elit ut aliquam purus sit amet. Suspendisse sed nisi lacus sed viverra tellus in. Tempus iaculis urna id volutpat lacus laoreet non curabitur gravida. Duis ultricies lacus sed turpis tincidunt. Fermentum iaculis eu non diam phasellus vestibulum. Iaculis urna id volutpat lacus laoreet non curabitur. Semper risus in hendrerit gravida rutrum quisque non. Convallis convallis tellus id interdum velit laoreet.</p>
</div>
</div>
<div class="popup-button"><button class="pum-close popmake-close button-green" type="button" aria-label="Close" disabled="">Agree</button></div> </div>
</div>
#popmake-wrap {
max-width:400px;
margin:1em auto;
font-family: sans-serif;
font-size: 15px;
}
/* wraps */
.scrollwrap {
position: relative;
max-height: 40vh;
height: 400px;
margin-bottom: 1.5em;
}
.popupscroll {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
padding-right: 8px;
overflow-y: scroll;
}
/* button */
.button-green {
font-size: 1em;
color: #fff;
background: #7EB501;
padding: .728em 1.62em;
border: none;
text-align: center;
cursor:pointer;
min-width: 8em;
border-radius: .34em;
transition: all .2s ease-out;
}
.button-green:hover, .button-green:active {
background: #4B9A0C;
}
#popmake-wrap .button-green[disabled] {
background: #AED15F;
cursor: not-allowed;
}
/* scrollbar redesigned */
.popupscroll::-webkit-scrollbar {
width: 8px;
background-color: #eaeaea;
}
.popupscroll::-webkit-scrollbar-thumb {
border-radius: 1em;
background-color: #4B9A0C;
}
.popupscroll::-webkit-scrollbar-track {
border-radius: 1em;
background-color: #eaeaea;
}
.popupscroll::-webkit-scrollbar-thumb:hover {
background: #4B9A0C;
}
.popupscroll::-webkit-scrollbar-thumb:active {
background: #4B9A0C;
}
/* different bg color for mobiles */
@media(min-width:768px) {
.popupscroll::-webkit-scrollbar-thumb {
background-color: #818181;
}
}
// popup disaable button untill user scrolls
jQuery(document).ready(function($) {
// disable button
$('#popmake-wrap .button-green').prop('disabled', true);
$('#popmake-wrap .popupscroll').scroll(function() {
if($(this).scrollTop() + $(this).height() > $(this)[0].scrollHeight - 80){
//enable button
$('#popmake-wrap .button-green').prop('disabled', false);
}
});
});
Also see: Tab Triggers