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="image"></div>
<section class="content">
<h3>Parallax Effect</h3>
<p>Lorem ipsum dolor sit amet, at nec solet principes. Mazim viris perpetua duo te, eum rebum necessitatibus ex. Ea veritus mediocrem vis. Sea no constituto consequuntur, no vix quot ludus. Ei vel semper consequuntur, ex percipitur referrentur mei.</p>
<hr>
<p>Sed iaculis rutrum mi, at fermentum neque fringilla at. Nullam blandit vehicula erat eu ultrices. Vestibulum at lectus eleifend urna convallis consectetur vitae id diam. Integer ultrices velit et magna imperdiet, quis tincidunt nisl semper. Proin in porta nibh. Cras ullamcorper sed urna vitae accumsan. Vivamus scelerisque dolor laoreet vulputate interdum. Nulla consectetur urna eu vulputate suscipit. Sed convallis hendrerit fringilla.<br><br>Duis sagittis sapien euismod, euismod urna nec, aliquet leo. In hac habitasse platea dictumst. Integer auctor mattis metus ut dapibus. Mauris lobortis, metus at interdum placerat, enim mauris pharetra sem, a hendrerit sem libero at sem. Suspendisse sem turpis, tempor eget nisi sed, scelerisque pellentesque nisi. Proin porta vel ante eget facilisis. Nunc risus sem, tincidunt quis vehicula at, bibendum sed tellus. Quisque urna neque, tincidunt id diam vel, pharetra condimentum nulla. Mauris tincidunt neque eget diam mollis luctus. Integer faucibus nibh tortor, a bibendum eros hendrerit sed. Etiam sed sagittis augue, pellentesque rhoncus eros. Nam consequat felis in nisl venenatis vehicula. Donec luctus mollis pellentesque. In hac habitasse platea dictumst. Integer sed quam quis diam suscipit semper. Nulla sed lectus a elit lacinia gravida. Morbi pretium pellentesque ante eget pharetra. Etiam sed posuere arcu, at mattis nulla. Integer molestie orci luctus arcu consectetur, at rutrum felis tempus. In iaculis sem sit amet auctor cursus. Donec laoreet mollis rutrum. Morbi eget mi ac est imperdiet dictum. Nunc volutpat ac risus sed congue.<br><br>Suspendisse vel pharetra velit. Maecenas quis luctus tortor, at lobortis lacus. Integer lobortis eros augue, eu cursus purus semper vitae. In convallis eu est malesuada accumsan. Integer congue scelerisque tempus. Nullam eget enim velit. Sed rhoncus turpis sit amet nunc accumsan, vitae commodo metus varius. Aenean id ligula mi. Vestibulum non eleifend leo. Nullam in risus diam. Etiam posuere imperdiet turpis sed ornare. Donec dictum nisi mi, eu aliquam lectus lobortis sed. Cras nisl nunc, congue fermentum enim sed, sollicitudin vulputate enim. Proin accumsan luctus tincidunt. Sed dictum dui at urna porttitor, in sagittis sapien tempor. Sed quam sapien, feugiat ut dignissim id, imperdiet et nisl.<br><br>Vestibulum at risus a erat blandit condimentum. In hac habitasse platea dictumst. In placerat elit sit amet bibendum mollis. Duis tempus faucibus nulla sed condimentum. Mauris elementum non odio nec iaculis. Proin viverra bibendum arcu nec vulputate. Cras libero elit, sagittis a nisl ut, adipiscing gravida leo. Sed ut congue magna.<br><br>In convallis scelerisque pellentesque. Suspendisse at rutrum velit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec vehicula augue fringilla lacinia euismod. Sed iaculis neque at sem volutpat tempor. Ut feugiat lectus ante, a ultrices diam pharetra vel. Pellentesque dapibus vitae mi ac sollicitudin. Aliquam ornare nunc augue, vitae luctus felis iaculis ut.<br><br>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Quisque vitae nibh elit. Duis sed iaculis urna. Maecenas mattis, augue ac commodo molestie, leo nulla euismod urna, ullamcorper feugiat nulla tortor id ligula. Duis facilisis lorem vitae faucibus mattis. Mauris id metus orci. Mauris vitae iaculis erat. Mauris condimentum quam blandit magna sagittis dignissim. Aliquam eu magna quis elit aliquet hendrerit.<br><br>Nunc ornare nisl et dolor dapibus egestas. Phasellus a ligula a metus condimentum ornare sed sit amet odio. Nunc malesuada ornare orci, eu cursus sem venenatis sed. Suspendisse tortor erat, vulputate ac tellus quis, lacinia porta nulla. Sed ac quam venenatis, rutrum neque at, eleifend nulla. Quisque placerat auctor eleifend. Maecenas convallis justo in nisl vulputate euismod. Suspendisse tincidunt purus nibh, id accumsan neque suscipit ut. Ut vehicula, velit in pharetra imperdiet, augue justo pellentesque tortor, eu dignissim mi velit ut sapien. Proin eget tempor neque, nec vehicula ipsum. Donec vitae lacus bibendum, bibendum nisi eget, malesuada sem. Nunc cursus mauris et gravida dictum. Sed volutpat tellus justo, et molestie diam vehicula vitae. Aenean tincidunt justo ac viverra fringilla. Donec congue molestie congue. Nunc bibendum, risus in blandit tempus, felis tortor porttitor ante, ac lacinia libero eros id purus. Proin a aliquam mauris, eget scelerisque felis. Pellentesque nec quam vehicula tortor dignissim gravida eu eu arcu. Proin molestie arcu ac dui dictum aliquam sed at odio. Suspendisse massa justo, laoreet a odio et, semper lobortis tellus. Nulla sagittis dui eget libero semper, a porta est aliquam. Morbi porttitor odio ac sem porttitor tempor. Sed suscipit id libero tristique fermentum. Sed nisi lectus, condimentum non sapien eu, luctus vestibulum leo. Nunc rutrum diam in enim iaculis, nec rhoncus ipsum egestas. Nulla convallis est vitae mollis sagittis.</p>
<p><a href="javascript:window.location.href=window.location.href">< back</a></p>
</section>
@import url(https://fonts.googleapis.com/css?family=Noto+Sans:400,700);
* {
-webkit-font-smoothing: antialiased;
-webkit-text-size-adjust: 100%; }
body {
background-color: #f4f4f4;
font-weight: normal;
font-style: normal;
margin: 0;
padding: 0;
border: 0; }
h3 {
font-family: 'Noto Sans', serif;
font-size: 2em;
color: #333;
}
p {
font-family: 'Noto Sans', sans-serif;
font-size: 1.3em;
line-height: 1.5em;
color: #666;
margin: 30px 0;
}
.image {
background: url('http://farm6.staticflickr.com/5104/5862419072_7f9632f068_b.jpg') no-repeat fixed;
background-position: center center;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
min-height: 500px;
}
.content {
max-width: 960px;
margin: 0 auto;
box-sizing: border-box;
-moz-box-sizing: border-box;
position: relative;
z-index: 2;
height: 100%;
}
a:link, a:visited {
color: #666;
text-decoration: underline; }
a:hover {
color: #01c59f; }
// See this details and thanks for visiting my codepen. All rights of the photo are from https://www.flickr.com/photos/statelibraryofnsw/
Also see: Tab Triggers