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='brochure'>
<div class='brochure__bg-shadows'>
<div class='shadow-wrapper shadow-wrapper--1'>
<div class='shadow'></div>
</div>
<div class='shadow-edge'></div>
<div class='shadow-edge'></div>
</div>
<div class='brochure__bg-shadows'>
<div class='shadow-wrapper shadow-wrapper--2'>
<div class='shadow'>
</div>
</div>
<div class='shadow-edge'></div>
</div>
<div class='brochure__bg-shadows'>
<div class='shadow-wrapper shadow-wrapper--3'>
<div class='shadow'>
</div>
</div>
<div class='shadow-edge'></div>
</div>
<!-- brochure__bg-shadows END -->
<div class='brochure__pages brochure__pages--page1'>
<div class='page1-logo'></div>
<h4 class='page1-heading'>Lorem ipsum </h4>
<p class='page1-text'>ante ipsum primis</p>
<p class='page1-footer'>facilisis laoreet lorem</p>
</div>
<div class='brochure__pages brochure__pages--page2'>
<h1 class='page2-heading'>Proin consequat</h1>
<div class='icons page2-icons'>
<i class="fa fa-envira" aria-hidden="true"></i>
<i class="fa fa-wpbeginner" aria-hidden="true"></i>
<i class="fa fa-sign-language" aria-hidden="true"></i>
<i class="fa fa-glide-g" aria-hidden="true"></i>
<i class="fa fa-braille" aria-hidden="true"></i>
<i class="fa fa-briefcase" aria-hidden="true"></i>
<i class="fa fa-camera-retro" aria-hidden="true"></i>
<i class="fa fa-cubes" aria-hidden="true"></i>
<i class="fa fa-heartbeat" aria-hidden="true"></i>
<i class="fa fa-motorcycle" aria-hidden="true"></i>
<i class="fa fa-toggle-off" aria-hidden="true"></i>
<i class="fa fa-tree" aria-hidden="true"></i>
</div>
</div>
<div class='brochure__pages brochure__pages--page3'>
<div class='icons page3-icons'>
<i class="fa fa-envira fa-page3" aria-hidden="true"></i>
<i class="fa fa-wpbeginner fa-page3" aria-hidden="true"></i>
<i class="fa fa-sign-language fa-page3" aria-hidden="true"></i>
<i class="fa fa-glide-g fa-page3" aria-hidden="true"></i>
<i class="fa fa-braille fa-page3" aria-hidden="true"></i>
<i class="fa fa-briefcase fa-page3" aria-hidden="true"></i>
<i class="fa fa-camera-retro fa-page3" aria-hidden="true"></i>
<i class="fa fa-cubes fa-page3" aria-hidden="true"></i>
<i class="fa fa-heartbeat fa-page3" aria-hidden="true"></i>
<i class="fa fa-motorcycle fa-page3" aria-hidden="true"></i>
<i class="fa fa-toggle-off fa-page3" aria-hidden="true"></i>
<i class="fa fa-tree fa-page3" aria-hidden="true"></i>
</div>
</div>
<div class='brochure__pages brochure__pages--page4'>
<div class='icons page4-icons'>
<i class="fa fa-wpbeginner" aria-hidden="true"></i>
<i class="fa fa-braille" aria-hidden="true"></i>
<i class="fa fa-motorcycle" aria-hidden="true"></i>
<i class="fa fa-glide-g" aria-hidden="true"></i>
<i class="fa fa-briefcase" aria-hidden="true"></i>
<i class="fa fa-cubes" aria-hidden="true"></i>
<i class="fa fa-envira" aria-hidden="true"></i>
<i class="fa fa-heartbeat" aria-hidden="true"></i>
<i class="fa fa-tree" aria-hidden="true"></i>
<i class="fa fa-sign-language" aria-hidden="true"></i>
<i class="fa fa-camera-retro" aria-hidden="true"></i>
<i class="fa fa-toggle-off" aria-hidden="true"></i>
</div>
</div>
<div class='brochure__pages brochure__pages--page5'>
<div class='icons page5-icons'>
<i class="fa fa-wpbeginner fa-page5" aria-hidden="true"></i>
<i class="fa fa-glide-g fa-page5" aria-hidden="true"></i>
<i class="fa fa-camera-retro fa-page5" aria-hidden="true"></i>
<i class="fa fa-heartbeat fa-page5" aria-hidden="true"></i>
<i class="fa fa-braille fa-page5" aria-hidden="true"></i>
<i class="fa fa-envira fa-page5" aria-hidden="true"></i>
<i class="fa fa-briefcase fa-page5" aria-hidden="true"></i>
<i class="fa fa-tree fa-page5" aria-hidden="true"></i>
<i class="fa fa-cubes fa-page5" aria-hidden="true"></i>
<i class="fa fa-motorcycle fa-page5" aria-hidden="true"></i>
<i class="fa fa-toggle-off fa-page5" aria-hidden="true"></i>
<i class="fa fa-sign-language fa-page5" aria-hidden="true"></i>
</div>
</div>
<div class='brochure__pages brochure__pages--page6'>
<h1 class='page6-heading'>CONTACT</h1>
<p class='page6-text'>Pellentesque tristique dolor sit amet tortor placerat, et bibendum urna ullamcorper</p>
<div class='page6-logo'></div>
<p class='page6-text-footer'>Vestibulum ante</p>
<p class='page6-text-footer'>Pellentesque tristique dolor sit<br> Sed at mi id purus efficitur pulvinar vitae et eros.
</p>
</div>
</div>
<div class='stuff'><a href='https://codepen.io/mrspok407/' class='pens' target="_blank">Check out my other pens</a><a href="https://twitter.com/mrspok407" target="_blank"><i class="fa fa-twitter" aria-hidden="true"></i></a></div>
*,
*:before,
*:after {
box-sizing: border-box;
margin: 0;
padding: 0;
}
$clrPagesDark: #F3F1E5;
$clrPagedLight: linear-gradient(to top, #F8EBE3 0%, #FFFFFF 100%);
body {
height: 100vh;
background-image: linear-gradient(to left bottom, #F2E3C6 0%, #A7A1A5 100%);
overflow: hidden;
font-family: 'Open Sans', sans-serif;
}
.stuff {
position: absolute;
bottom: 30px;
width: 100%;
text-align: center;
.pens {
margin-right: 20px;
text-decoration: none;
font-size: 20px;
color: #333;
&:hover {
text-decoration: underline;
}
}
.fa-twitter {
position: relative;
top: 8px;
color: #1DA1F2;
font-size: 50px;
}
}
@mixin pseudo {
content: '';
display: block;
position: absolute;
}
@mixin mediaMaxW($width) {
@media screen and (max-width: $width) {
@content;
}
}
.brochure {
display: flex;
position: absolute;
left: 100px;
right: 0;
bottom: 0;
top: -200px;
margin: auto;
justify-content: center;
height: 250px;
width: 1280px;
perspective: 2000px;
@include mediaMaxW(1228px) {
width: 960px;
}
////////////// Pages ////////////////
&__pages {
position: relative;
height: 250px;
width: calc(100% / 6);
overflow: hidden;
&--page1 {
transform: rotateY(-30deg);
background-image: linear-gradient(to right top, #7A302B 0%, #A74131 84%);
box-shadow: 0 0 2px rgba(0,0,0,.1);
z-index: 10;
.page1-logo {
position: relative;
margin: 30px 0 0 20px;
width: 35px;
height: 35px;
border: 8px solid #191919;
&:after {
@include pseudo;
top: -15px;
right: -8px;
width: 8px;
height: 22px;
background-color: #CFCDC3;
}
&:before {
@include pseudo;
top: -8px;
right: -15px;
width: 22px;
height: 8px;
background-color: #CFCDC3;
}
}
.page1-heading {
margin: 15px 0 0 20px;
text-transform: uppercase;
color: #afafaf;
font: {
size: 7px;
}
}
.page1-text {
margin: 3px 20px;
text-transform: uppercase;
color: #afafaf;
font: {
size: 4px;
}
}
.page1-footer {
margin: 125px 0 0 20px;
text-transform: uppercase;
color: #afafaf;
font: {
size: 4px;
}
}
}
&--page2 {
transform: rotateY(30deg);
left: -2.20%;
background-image: $clrPagedLight;
box-shadow: -110px 65px 180px -38px rgba(0, 0, 0, 0.5), 25px 40px 180px -38px rgba(0, 0, 0, 0.5), 160px 20px 180px -38px rgba(0, 0, 0, 0.5);
@include mediaMaxW(1228px) {
box-shadow: -100px 50px 180px -38px rgba(0, 0, 0, 1), 25px 40px 180px -38px rgba(0, 0, 0, 0.5), 160px 20px 180px -38px rgba(0, 0, 0, 0.5);
}
.page2-heading {
margin: 20px 0 0 20px;
text-transform: uppercase;
color: #afafaf;
font: {
size: 7px;
}
}
&:after {
@include pseudo;
top: 0;
right: -43px;
bottom: -108px;
transform: skew(-20deg);
height: 170px;
width: 75px;
background-color: rgba(0, 0, 0, .2);
transition: .55s;
}
&:before {
@include pseudo;
bottom: 0px;
right: -12px;
height: 80px;
width: 75px;
background-color: rgba(0, 0, 0, .2);
box-shadow: -2px 3px 3px 0px rgba(0, 0, 0, .2);
transition: .55s;
}
}
&--page3 {
background-color: $clrPagesDark;
left: -4.5%;
transform: rotateY(-30deg);
box-shadow: 80px 51px 215px -38px rgba(0, 0, 0, 0.75);
overflow: initial;
&:after {
@include pseudo;
top: 0;
height: 100%;
width: 100%;
background-color: rgba(0, 0, 0, .15);
box-shadow: -3px 0px 5px -2px rgba(0, 0, 0, 0.2), inset 3px 0px 5px -2px rgba(0, 0, 0, 0.2);
}
}
&--page4 {
@extend .brochure__pages--page2;
box-shadow: 0 0 2px rgba(0,0,0,.1);
left: -6.80%;
z-index: 1;
}
&--page5 {
left: -9.05%;
transform: translate3d(0, 0, 0);
transform: rotateY(-30deg);
background-color: $clrPagesDark;
box-shadow: -100px 65px 75px -38px rgba(188, 180, 173, .5);
overflow: initial;
&:after {
@include pseudo;
top: 0;
height: 100%;
width: 100%;
background-color: rgba(0, 0, 0, .15);
box-shadow: -3px 0px 5px -2px rgba(0, 0, 0, 0.2), inset 3px 0px 5px -2px rgba(0, 0, 0, 0.2);
}
}
&--page6 {
left: -11.3%;
transform: rotateY(30deg);
background-image: linear-gradient(to right top, #C46041 18%, #FF8059 65%);
box-shadow: -100px 40px 215px -38px rgba(0, 0, 0, 0.75);
overflow: initial;
z-index: -3;
.page6-heading {
margin: 20px 0 0 20px;
text-transform: uppercase;
color: #fff;
font: {
size: 7px;
}
}
.page6-text {
margin: 20px 20px;
text-transform: uppercase;
color: #fff;
font: {
size: 4px;
}
}
.page6-text-footer {
margin: 5px 20px;
text-transform: uppercase;
color: #fff;
font: {
size: 4px;
}
}
.page6-logo {
position: relative;
margin: 135px 0 0 20px;
width: 10px;
height: 10px;
border: 3px solid #191919;
&:after {
@include pseudo;
top: -6px;
right: -3px;
width: 3px;
height: 9px;
background-color: #fff;
}
&:before {
@include pseudo;
top: -3px;
right: -7px;
width: 11px;
height: 3px;
background-color: #fff;
}
}
}
}
////////////// Icons ///////////////
.icons {
margin-top: 5px;
width: 100%;
height: 100%;
text-align: center;
}
.page3-icons,
.page4-icons,
.page5-icons {
margin-top: 35px;
}
.fa {
margin-top: 20px;
width: 30%;
font-size: 20px;
}
.fa-envira {
color: #41db81;
}
.fa-wpbeginner {
color: #fd583f;
}
.fa-sign-language {
color: #48d1cc;
}
.fa-glide-g {
color: #ff95da;
}
.fa-braille {
color: #98a1a5;
}
.fa-briefcase {
color: #a20932;
}
.fa-camera-retro {
color: #70321b;
}
.fa-cubes,
.fa-motorcycle {
color: #373e36;
}
.fa-heartbeat {
color: #fd583f;
}
.fa-toggle-off {
color: #192fda;
}
.fa-tree {
color: #055910;
}
.fa-page3,
.fa-page5 {
color: #333;
}
//////////////// Shadows //////////////
&__bg-shadows {
.shadow-edge {
position: absolute;
top: 320px;
right: -112px;
transform: rotate(-19.9deg);
width: 560px;
height: 1px;
background-color: rgba(164, 156, 151, 1);
box-shadow: 0 0 8px 5px rgba(164, 156, 151, 1);
z-index: -99999;
}
}
&__bg-shadows:first-child {
position: absolute;
top: 25px;
left: 10%;
height: 225px;
width: 260px;
border-radius: 50%;
box-shadow: 0px 0px 200px 10px rgba(0, 0, 0, 0.65);
z-index: -9999;
transition: .67s;
.shadow-wrapper--1 {
top: 100px;
right: 125px;
height: 275px;
width: 500px;
overflow: initial;
.shadow {
box-shadow: -50px 20px 75px 0px #A49C97;
&:after {
@include pseudo;
top: -65px;
right: 225px;
transform: skewY(20deg) rotate(-38deg);
width: 300px;
height: 150px;
background: rgb(164, 156, 151);
box-shadow: -50px -35px 100px 0px rgb(164, 156, 151), -80px -60px 30px -60px rgb(164, 156, 151);
@include mediaMaxW(1228px) {
top: -80px;
right: 170px;
transform: skewY(20deg) rotate(-29deg);
height: 94px;
width: 300px;
}
}
@include mediaMaxW(1228px) {
top: 0px;
left: 0;
right: 0;
height: 240px;
}
}
}
.shadow-edge {
top: 310px;
transform: rotate(-19deg);
width: 600px;
@include mediaMaxW(1228px) {
top: 272px;
}
}
.shadow-edge:last-child {
top: 32px;
right: 345px;
width: 150px;
transform: rotate(-38deg);
@include mediaMaxW(1228px) {
top: 58px;
right: 320px;
transform: rotate(-28deg);
width: 315px;
}
}
}
&__bg-shadows:nth-child(2) {
position: absolute;
top: 20px;
left: 37%;
height: 225px;
width: 225px;
border-radius: 50%;
box-shadow: 0px 0px 200px 10px rgba(0, 0, 0, .55);
z-index: -9998;
.shadow-wrapper--2 {
right: -50px;
box-shadow: 150px 140px 120px -100px rgba(142, 135, 129, 1);
overflow: hidden;
@include mediaMaxW(1228px) {
top: 69px;
right: 20px;
width: 480px;
}
}
.shadow-edge {
top: 316px;
right: -75px;
transform: rotate(-19.9deg);
box-shadow: 0 0 8px 5px rgba(164, 156, 151, .75);
@include mediaMaxW(1228px) {
top: 290px;
}
}
}
&__bg-shadows:nth-child(3) {
position: absolute;
top: 20px;
left: 61%;
height: 225px;
width: 225px;
border-radius: 50%;
box-shadow: 0px 0px 200px 10px rgba(0, 0, 0, .4);
z-index: -9997;
transition: .67s;
.shadow-edge {
@include mediaMaxW(1228px) {
top: 298px;
right: -27px;
transform: rotate(-20deg);
width: 420px;
}
}
.shadow-wrapper {
overflow: hidden;
@include mediaMaxW(1228px) {
top: 66px;
}
}
}
.shadow-wrapper {
position: absolute;
top: 88px;
right: -102px;
transform: skewY(-20deg);
height: 244px;
width: 580px;
.shadow {
position: absolute;
left: 70px;
height: 100%;
width: 100%;
background: #A49C97;
box-shadow: -40px 30px 50px 1px rgb(164, 156, 151);
}
@include mediaMaxW(1228px) {
top: 68px;
right: -22px;
width: 450px;
}
}
}
// Not today
Also see: Tab Triggers