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. You can use the CSS from another Pen by using it's URL and the proper URL extention.
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 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.
main
.wall
.wire
svg(width="37", height="996", viewBox="0 0 37 996", fill="none")
path(
d="M21.1565 3C28.7233 25.5557 40.896 120.976 29.0523 186.878C13.2606 257.487 4.17925 253.074 21.1565 351.633C29.7934 401.773 34.5831 410.474 29.0523 450.192C13.9188 500.207 -10.228 498.736 13.2606 601.707C31.0262 694.382 12.075 657.606 4.17925 772.346C0.231591 829.716 6.94395 852.37 13.2606 872.376C21.1565 904.248 13.2606 960.637 20.7655 993",
stroke="#fff3e8",
stroke-width="3",
stroke-linecap="round",
stroke-linejoin="round"
)
.light.light--one
.light.light--two
.light.light--three
.light.light--four
.light.light--five
.light.light--six
.light.light--last
a.polaroid.polaroid--one(href="https://codepen.io/oliviale/full/xxboXzo", data-name="Toggles")
img(
src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/567707/showcase-toggles.png"
)
a.polaroid.polaroid--two(
href="https://codepen.io/oliviale/full/BaKamvY",
data-name="Stats Dashboard"
)
img(src="https://assets.codepen.io/567707/showcase-stats.png")
.wire
svg(width="37", height="996", viewBox="0 0 37 996", fill="none")
path(
d="M21.1565 3C28.7233 25.5557 40.896 120.976 29.0523 186.878C13.2606 257.487 4.17925 253.074 21.1565 351.633C29.7934 401.773 34.5831 410.474 29.0523 450.192C13.9188 500.207 -10.228 498.736 13.2606 601.707C31.0262 694.382 12.075 657.606 4.17925 772.346C0.231591 829.716 6.94395 852.37 13.2606 872.376C21.1565 904.248 13.2606 960.637 20.7655 993",
stroke="#fff3e8",
stroke-width="3",
stroke-linecap="round",
stroke-linejoin="round"
)
.light.light--one
.light.light--two
.light.light--three
.light.light--four
.light.light--five
.light.light--six
.light.light--last
a.polaroid.polaroid--three(
href="https://codepen.io/oliviale/full/BaoXOOP",
data-name="Newspaper Layout"
)
img(src="https://assets.codepen.io/567707/showcase-newspaper.png")
a.polaroid.polaroid--four(
href="https://codepen.io/oliviale/full/qBZWEWj",
data-name="App Landing Page"
)
img(src="https://assets.codepen.io/567707/showcase-applp.png")
.wire
svg(width="37", height="996", viewBox="0 0 37 996", fill="none")
path(
d="M21.1565 3C28.7233 25.5557 40.896 120.976 29.0523 186.878C13.2606 257.487 4.17925 253.074 21.1565 351.633C29.7934 401.773 34.5831 410.474 29.0523 450.192C13.9188 500.207 -10.228 498.736 13.2606 601.707C31.0262 694.382 12.075 657.606 4.17925 772.346C0.231591 829.716 6.94395 852.37 13.2606 872.376C21.1565 904.248 13.2606 960.637 20.7655 993",
stroke="#fff3e8",
stroke-width="3",
stroke-linecap="round",
stroke-linejoin="round"
)
.light.light--one
.light.light--two
.light.light--three
.light.light--four
.light.light--five
.light.light--six
.light.light--last
a.polaroid.polaroid--five(href="https://codepen.io/oliviale/full/BaovGmg", data-name="One Div Pie")
img(
src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/567707/showcase-pie.jpg"
)
a.polaroid.polaroid--six(
href="https://codepen.io/oliviale/full/XWXNKMq",
data-name="Apps Have Feelings Too"
)
img(src="https://assets.codepen.io/567707/showcase-apps.png")
.wire
svg(width="37", height="996", viewBox="0 0 37 996", fill="none")
path(
d="M21.1565 3C28.7233 25.5557 40.896 120.976 29.0523 186.878C13.2606 257.487 4.17925 253.074 21.1565 351.633C29.7934 401.773 34.5831 410.474 29.0523 450.192C13.9188 500.207 -10.228 498.736 13.2606 601.707C31.0262 694.382 12.075 657.606 4.17925 772.346C0.231591 829.716 6.94395 852.37 13.2606 872.376C21.1565 904.248 13.2606 960.637 20.7655 993",
stroke="#fff3e8",
stroke-width="3",
stroke-linecap="round",
stroke-linejoin="round"
)
.light.light--one
.light.light--two
.light.light--three
.light.light--four
.light.light--five
.light.light--six
.light.light--last
.wire
svg(width="37", height="996", viewBox="0 0 37 996", fill="none")
path(
d="M21.1565 3C28.7233 25.5557 40.896 120.976 29.0523 186.878C13.2606 257.487 4.17925 253.074 21.1565 351.633C29.7934 401.773 34.5831 410.474 29.0523 450.192C13.9188 500.207 -10.228 498.736 13.2606 601.707C31.0262 694.382 12.075 657.606 4.17925 772.346C0.231591 829.716 6.94395 852.37 13.2606 872.376C21.1565 904.248 13.2606 960.637 20.7655 993",
stroke="#fff3e8",
stroke-width="3",
stroke-linecap="round",
stroke-linejoin="round"
)
.light.light--one
.light.light--two
.light.light--three
.light.light--four
.light.light--five
.light.light--six
.light.light--last
a.polaroid.polaroid--seven(
href="https://codepen.io/oliviale/full/jOryjNX",
data-name="26 Days in Peru"
)
img(src="https://assets.codepen.io/567707/showcase-perustats.png")
a.polaroid.polaroid--eight(href="https://codepen.io/oliviale/full/gOrEmpz", data-name="Noisy Keys")
img(src="https://assets.codepen.io/567707/showcase-keys.png")
.wire
svg(width="37", height="996", viewBox="0 0 37 996", fill="none")
path(
d="M21.1565 3C28.7233 25.5557 40.896 120.976 29.0523 186.878C13.2606 257.487 4.17925 253.074 21.1565 351.633C29.7934 401.773 34.5831 410.474 29.0523 450.192C13.9188 500.207 -10.228 498.736 13.2606 601.707C31.0262 694.382 12.075 657.606 4.17925 772.346C0.231591 829.716 6.94395 852.37 13.2606 872.376C21.1565 904.248 13.2606 960.637 20.7655 993",
stroke="#fff3e8",
stroke-width="3",
stroke-linecap="round",
stroke-linejoin="round"
)
.light.light--one
.light.light--two
.light.light--three
.light.light--four
.light.light--five
.light.light--six
.light.light--last
a.polaroid.polaroid--nine(
href="https://codepen.io/oliviale/full/oNXJgEM",
data-name="To-do Terrarium"
)
img(
src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/567707/showcase-terrarium.jpg"
)
a.polaroid.polaroid--ten(
href="https://codepen.io/oliviale/full/RwWKybY",
data-name="Workout Schedule"
)
img(
src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/567707/showcase-workout.jpg"
)
body {
background: #000;
background-image: radial-gradient(
ellipse at 50%,
rgba(0, 0, 0, 0.8%),
rgba(0, 0, 0, 0.9%)
);
position: relative;
padding-bottom: 10rem;
font-family: 'Itim', sans-serif;
}
* {
box-sizing: border-box;
}
.wall {
padding: 0 5rem;
display: grid;
grid-template-columns: 1fr 1.2fr;
grid-column-gap: 4rem;
max-width: 90rem;
margin: auto;
position: relative;
@media (min-width: 40rem) {
grid-template-columns: 1fr 1.2fr 1fr;
}
@media (min-width: 70rem) {
grid-template-columns: 1fr 1.5fr 0.6fr 0.3fr 1.4fr 1fr;
}
}
.wire {
position: relative;
height: auto;
text-align: center;
width: 100%;
@media (min-width: 70rem) {
&:nth-child(2n) {
transform: translateY(-14rem);
}
&:nth-child(3) {
transform: translateY(-8rem);
}
&:nth-child(4) {
z-index: -1;
}
&:nth-child(6) {
transform: translateY(-3rem);
}
}
svg {
margin: auto;
}
}
.light {
height: 1.5rem;
width: 0.6rem;
background: #fff3e8;
border-radius: 100%;
position: absolute;
left: 50%;
transform: translateX(-50%);
bottom: 0;
&:before {
content: "";
width: 0.8rem;
height: 0.8rem;
border-radius: 50%;
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
background: #fff;
box-shadow: 0px 0px 10px #FFEB3B, inset 0 -0.35rem 0.6rem #eebd39, 0 1rem 5rem 3rem rgba(255, 174, 71, 0.5), 0 1rem 4rem 9rem rgba(234, 162, 58, 0.1);
}
}
.light {
&--one {
top: 5%;
transform: translateX(-15%) rotate(120deg);
}
&--two {
top: 20%;
transform: translateX(90%) rotate(-50deg);
}
&--three {
top: 35%;
transform: translateX(-10%) rotate(-5deg);
}
&--four {
top: 50%;
transform: translateX(-90%) rotate(-105deg);
}
&--five {
top: 65%;
transform: translateX(-70%) rotate(15deg);
}
&--six {
top: 80%;
transform: translateX(-100%) rotate(-105deg);
}
}
.polaroid {
position: absolute;
padding: 0.5rem 0.5rem 2rem;
background: #ffffff;
border: 3px solid #000;
line-height: 0;
box-shadow: 0 2px 55px rgba(255, 255, 255, 0.3);
left: 50%;
transform: translateX(-50%);
z-index: 12;
text-decoration: none;
color: #000;
transition: transform .35s ease;
&:before {
content: "";
width: 1.4rem;
height: 5rem;
background: linear-gradient(
to bottom,
#c28f52,
#edc491 73%,
#222 73%,
#222 78%,
#edc491 78%
);
top: -3rem;
left: 40%;
position: absolute;
transform: rotate(-25deg);
border-radius: 3px;
box-shadow: 0 2px 3px rgba(0, 0, 0, 0.6);
}
&:after {
content: attr(data-name);
width: 100%;
bottom: 1rem;
left: 0;
position: absolute;
font-size: 90%;
}
img {
width: 10rem;
height: 10rem;
object-fit: cover;
object-position: top left;
border: 2px solid #000;
}
&--one {
top: 20%;
transform: rotate(-2deg) translateX(-50%);
}
&--two {
top: 60%;
&:before {
transform: rotate(15deg);
}
}
&--three {
top: 30%;
transform: rotate(3deg) translateX(-50%);
&:before {
transform: rotate(35deg);
}
}
&--four {
top: 77%;
transform: rotate(1.5deg) translateX(-55%);
&:before {
transform: rotate(-10deg);
}
}
&--five {
top: 35%;
left: 60%;
&:before {
transform: rotate(20deg);
}
}
&--six {
top: 55%;
left: 60%;
transform: rotate(2deg) translateX(-50%);
&:before {
content: none;
}
&:before {
content: "";
width: 55%;
height: 30px;
top: -20px;
z-index: 5;
left: 25%;
transform: rotate(-2deg);
position: absolute;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
background: rgba(220, 220, 220, 0.3);
}
}
&--seven {
top: 12%;
left: 60%;
&:before {
transform: rotate(-15deg);
}
}
&--eight {
top: 60%;
transform: rotate(3deg) translateX(-50%);
&:before {
transform: rotate(18deg);
}
}
&--nine {
top: 25%;
transform: rotate(-2deg) translateX(-50%);
&:before {
transform: rotate(18deg);
}
}
&--ten {
top: 70%;
}
&:hover {
transform: scale(1.1) translateX(-50%);
z-index: 100;
}
}
Also see: Tab Triggers