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.
<section id="s1">
<div id="outer">
<div id="inner">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/" x="0px" y="0px" width="323px" height="624.9px" viewBox="0 0 323 624.9" style="enable-background:new 0 0 323 624.9;"
xml:space="preserve">
<style type="text/css">
.st0{fill:none;stroke:#FFFFFF;stroke-width:5;stroke-miterlimit:10;}
</style>
<defs>
</defs>
<g>
<polyline class="st0" points="3,318.2 320.5,619.1 320.5,103.7 92.1,3.4 3,318.2 225.8,421.3 320.5,103.7 "/>
<line class="st0" x1="320.5" y1="619.1" x2="225.8" y2="421.3"/>
</g>
</svg>
</div>
</section>
<section id="s2">
<div class="top">
<h1>Lorem</h1>
<h1>Ipsum</h1>
</div>
<div>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Tempore impedit adipisci quam ea nulla, minus odit error a blanditiis, omnis sapiente? Ratione error incidunt architecto dolore autem ad necessitatibus debitis? Lorem ipsum dolor sit amet consectetur
adipisicing elit. Doloremque, rem itaque aut, tempora cupiditate dolor minima ipsum a, ducimus dicta reprehenderit. Est harum deleniti ducimus porro facere itaque qui hic. Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit eos maiores
necessitatibus, fugiat blanditiis hic. Earum, voluptas! Nihil assumenda soluta quaerat et quod quis inventore, dicta dolores ad aut. Aliquid. Lorem, ipsum dolor sit amet consectetur adipisicing elit. Exercitationem dicta blanditiis saepe sit, deleniti
animi error aliquam esse iste aut veritatis, nobis ullam doloremque, magni odio? Odit dolor provident itaque?Lorem ipsum dolor sit amet consectetur adipisicing elit. Praesentium obcaecati, quod maiores dolore neque consequuntur eveniet expedita
nobis eius, ipsa culpa beatae repellendus animi veritatis fugiat soluta commodi incidunt? Reiciendis. Lorem, ipsum dolor sit amet consectetur adipisicing elit. Lorem ipsum dolor sit amet consectetur adipisicing elit. Tempore impedit adipisci quam
ea nulla, minus odit error a blanditiis, omnis sapiente? Ratione error incidunt architecto dolore autem ad necessitatibus debitis? Lorem ipsum dolor sit amet consectetur adipisicing elit. Doloremque, rem itaque aut ut. Architecto. </p>
<div class="other">
<h1>LoremIpsum</h1>
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/108463/photo-1496147195884-6ab7f7c0a027.jpeg" alt="">
<h2>Lorem</h2>
</div>
</div>
</section>
<section id="s3">
<div id="d1">
<p>Lorem</p>
<p>Ipsum</p>
<p>Lorem</p>
<p>Ipsum</p>
<div id="square">
<div id="circle">
<div id="little-circle"></div>
</div>
</div>
</div>
</section>
<section id="s4">
<div id="top">
<div class="left"></div>
<div class="right"></div>
<p>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Amet ullam aliquid suscipit labore dolore nemo id nulla! Eius consequuntur, excepturi reiciendis repudiandae aliquid ea commodi quae ullam eligendi dicta aliquam! Lorem, ipsum dolor sit amet
consectetur adipisicing elit. Cum odio reprehenderit non ipsam, eius ab nemo? Esse qui omnis, voluptatum voluptas iusto voluptatem eius, sequi tempore ducimus dignissimos voluptates magnam. Lorem ipsum dolor sit, amet consectetur adipisicing elit.
Velit cum officia animi hic, rem laborum tenetur magnam architecto fugiat nulla aspernatur repellendus! Adipisci odio odit nulla at quos mollitia voluptates. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Itaque, numquam doloremque tempora
acu s?</p>
</div>
<div id="bottom">
<div class="left"></div>
<div class="right"></div>
<p>Lo rem ipsum, dolor sit amet consectetur adipisicing elit. Amet ullam aliquid suscipit labore dolore nemo id nulla! Eius consequuntur, excepturi reiciendis repudiandae aliquid ea commodi quae ullam eligendi dicta aliquam! Lorem ipsum dolor sit amet
consectetur, adipisicing elit. Laborum quibusdam facere, ullam nesciunt, minima maxime modi veniam exercitationem sed commodi animi molestias aliquam iure, possimus laudantium perspiciatis fuga suscipit ipsum. Lorem ipsum dolor sit, amet consectetur
adipisicing elit. Quisquam, fugit quo obcaecati laudantium fuga officia doloremque incidunt temporibus assumenda dolor aliquam deserunt adipisci quos molestiae eaque sequi quam magni sint. Lorem ipsum, dolor sit amet consectetur adipisicing elit.
Illum voluptatum voluptas dolore ea recusandae ipsum adipiscid.</p>
</div>
<div class="s4-tri t-left">
<div class="s4-t-in">
<div><b></b></div>
</div>
</div>
<div class="s4-tri t-right">
<div class="s4-t-in">
<div><b></b>
</>
</div>
</div>
</div>
</section>
<section id="s5">
<b class="one"></b>
<h1>Lorem Ipsum</h1>
<b class="two"></b>
</section>
:root {
--background: #018fd0; /* #0086c3 */
}
* {
box-sizing: border-box;
}
html {
height: 100%;
}
body {
margin: 0;
background-color: var(--background);
font-family: "Questrial", sans-serif;
font-weight: lighter;
color: white;
overflow-x: hidden;
}
#s1 {
display: flex;
align-items: center;
justify-content: center;
float: left;
width: 100vw;
height: 100vw;
border-radius: 50%;
margin-left: -50vw;
shape-outside: circle(57.56% at 0.56% 49.9%);
shape-margin: 4vw;
}
#s1 div#outer {
height: 90%;
width: 90%;
border-radius: 50%;
background-image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/108463/photo-1496147195884-6ab7f7c0a027.jpeg);
background-repeat: no-repeat;
background-size: cover;
display: flex;
align-items: center;
justify-content: center;
}
#inner {
background-color: var(--background);
height: 90%;
width: 90%;
border-radius: 50%;
display: grid;
grid-template-columns: 1fr 1fr;
text-align: justify;
}
#inner svg {
grid-column: 2;
align-self: center;
transform: rotatez(45deg);
height: 50vw;
}
#s2 div.top {
display: grid;
align-items: end;
justify-items: end;
height: 35vw;
}
h1 {
font-weight: lighter;
font-size: 6vw;
margin: 0;
}
#s2 div.top h1:nth-child(1) {
/* margin-right: 10vw; */
}
#s2 div.top h1:nth-child(2) {
writing-mode: vertical-rl;
text-orientation: upright;
justify-self: center;
}
.other {
position: absolute;
height: 100%;
width: 40%;
right: 0;
top: 35vw;
display: grid;
}
#s2 p {
text-align: justify;
hyphens: auto;
width: 60%;
margin: 0;
font-size: 1.6vw;
}
.other h1 {
writing-mode: vertical-rl;
text-orientation: upright;
justify-self: start;
grid-row: 1;
}
.other img {
width: 80%;
justify-self: end;
align-self: center;
grid-row: 1 / 3;
clip-path: circle(50% at 100% 50%);
}
.other h2 {
justify-self: center;
grid-column: 2;
font-weight: lighter;
font-size: 6vw;
margin: 0;
margin-right: -1vw;
margin-top: -5vw;
writing-mode: vertical-rl;
text-orientation: upright;
}
#s3 {
height: 95vh;
background-image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/108463/photo-1496147195884-6ab7f7c0a027.jpeg);
background-repeat: no-repeat;
background-size: cover;
margin: 20vw 5vw 10vw 5vw;
display: flex;
align-items: center;
justify-content: center;
}
#d1 {
background-color: var(--background);
height: 90%;
width: 90%;
display: grid;
}
#d1 p {
font-size: 6vw;
}
#d1 p:nth-child(1) {
grid-row: 1;
grid-column: 1 / 3;
justify-self: center;
align-self: start;
}
#d1 p:nth-child(2) {
grid-row: 1 / 3;
grid-column: 2;
justify-self: end;
align-self: center;
writing-mode: vertical-rl;
text-orientation: upright;
}
#d1 p:nth-child(3) {
grid-row: 2;
grid-column: 1 / 3;
justify-self: center;
align-self: end;
}
#d1 p:nth-child(4) {
grid-row: 1 / 3;
grid-column: 1;
justify-self: start;
align-self: center;
writing-mode: vertical-rl;
text-orientation: upright;
}
#square {
background-image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/108463/photo-1496147195884-6ab7f7c0a027.jpeg);
background-repeat: no-repeat;
background-size: cover;
height: 20vw;
width: 20vw;
justify-self: center;
align-self: center;
display: flex;
align-items: center;
justify-content: center;
grid-column: 1 / 3;
grid-row: 1 / 3;
}
#circle {
height: 70%;
width: 70%;
background-color: var(--background);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
}
#little-circle {
height: 60%;
width: 60%;
border: 3px solid white;
border-radius: 50%;
}
#top,
#bottom {
height: 40vw;
width: 100vw;
}
#top p,
#bottom p {
margin: 0;
text-align: justify;
hyphens: auto;
font-size: 1.6vw;
}
.left,
.right {
height: 100%;
width: 50%;
}
.left {
float: left;
}
.right {
float: right;
}
#top .left {
shape-outside: polygon(50% 0px, 100% 100%, 0px 100%);
}
#top .right {
shape-outside: polygon(50% 0px, 100% 100%, 0px 100%);
}
#bottom .left {
shape-outside: polygon(0px 0px, 100% 0px, 50% 100%);
}
#bottom .right {
shape-outside: polygon(100% 0px, 50% 100%, 0px 0px);
}
.s4-tri {
height: 40vw;
width: 40vw;
background-image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/108463/photo-1496147195884-6ab7f7c0a027.jpeg);
background-repeat: no-repeat;
background-size: cover;
z-index: 5;
margin: 5vw;
margin-top: -60vw;
display: flex;
align-items: center;
justify-content: center;
}
.t-left {
float: left;
clip-path: polygon(100% 50%, 0 0, 0 100%);
}
.t-right {
float: right;
clip-path: polygon(100% 0, 0 50%, 100% 100%);
}
.s4-t-in {
background-color: var(--background);
height: 80%;
width: 80%;
display: flex;
align-items: center;
justify-content: center;
}
.t-left .s4-t-in {
clip-path: polygon(100% 50%, 0 0, 0 100%);
}
.t-right .s4-t-in {
clip-path: polygon(100% 0, 0 50%, 100% 100%);
}
.s4-t-in div {
height: 80%;
width: 80%;
background-color: white;
display: flex;
align-items: center;
justify-content: center;
}
.t-left .s4-t-in div {
margin-left: -1.5%;
clip-path: polygon(100% 50%, 0 0, 0 100%);
}
.t-right .s4-t-in div {
margin-right: -1.5%;
clip-path: polygon(100% 0, 0 50%, 100% 100%);
}
.s4-t-in div b {
background-color: var(--background);
height: 95%;
width: 95%;
}
.t-left .s4-t-in div b {
margin-left: -1.5%;
clip-path: polygon(100% 50%, 0 0, 0 100%);
}
.t-right .s4-t-in div b {
margin-right: -1.5%;
clip-path: polygon(100% 0, 0 50%, 100% 100%);
}
#s5 {
height: 100vh;
display: grid;
margin-top: 15vw;
}
#s5 h1 {
align-self: center;
justify-self: center;
font-size: 8vw;
}
#s5 b {
height: 10vw;
width: 75vw;
background-image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/108463/photo-1496147195884-6ab7f7c0a027.jpeg);
background-repeat: no-repeat;
background-size: cover;
}
#s5 b.one {
align-self: start;
justify-self: end;
}
#s5 b.two {
align-self: end;
justify-self: start;
}
Also see: Tab Triggers