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.
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=VT323">
<div class="back">
<div class="base">
<div class="base" id="two">
<div class="base" id="three">
<div class="base" id="four">
<div class="base" id="five">
<div class="pokeball" id="first"></div>
<div class="pokeball" id="second"></div>
<div class="pokeball" id="third"></div>
</div>
</div>
</div>
</div>
<div class="ash"></div>
</div>
<div class="base" id="dialogue">
<h1>Choose wisely!...</h1>
<div class="fwd"></div>
</div>
* {
margin: 0px;
padding: 0px;
}
.back {
width: 100vw;
height: 100vh;
background: #E8E8E8;
align-items: center;
justify-content: center;
font-size: 3em;
display: flex;
position: relative;
}
.base {
width: 60vmin;
height: 30vmin;
color: #A1A1A1;
background: black;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
#two {
width: 63vmin;
height: 27vmin;
}
#three {
background: #575757;
width: 59vmin;
height: 25vmin;
}
#four {
width: 61vmin;
height: 22vmin;
box-shadow: 0 -2vmin black;
}
#five {
background: #999999;
width: 55vmin;
height: 18vmin;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
box-shadow:
0 -2vmin #999999,
-2vmin 0 white,
2vmin 0 white,
-2vmin -4vmin white,
2vmin -4vmin white
}
#dialogue {
position: absolute;
background: white;
top: 70vmin;
height: 25vmin;
width: 90vmin;
color: black;
box-shadow:
-1.5vmin 1.5vmin, 1.5vmin -1.5vmin,
-2.5vmin 2.5vmin white, -2.5vmin -2.5vmin white,
-1.5vmin -1.5vmin, 1.5vmin 1.5vmin
}
h1 {
font-family: VT323;
font-size: 12vmin;
text-align: left;
}
.fwd {
position: relative;
left: 35vmin;
top: 1vmin;
background: transparent;
height: 1vmin;
width: 1vmin;
color: black;
box-shadow:
1vmin 0, 2vmin 0, 3vmin 0, 4vmin 0, 5vmin 0, 6vmin 0,
2vmin 1vmin, 3vmin 1vmin, 4vmin 1vmin, 5vmin 1vmin,
3vmin 2vmin, 4vmin 2vmin;
animation: int 1s infinite;
}
.pokeball {
position: relative;
height: 1vmin;
width: 1vmin;
background: transparent;
color: white;
box-shadow:
5vmin 0 black, 6vmin 0 black, 7vmin 0 black, 8vmin 0 black,
3vmin 1vmin black, 4vmin 1vmin black, 5vmin 1vmin red, 6vmin 1vmin red, 7vmin 1vmin red, 8vmin 1vmin red, 9vmin 1vmin black, 10vmin 1vmin black,
2vmin 2vmin black, 3vmin 2vmin red, 4vmin 2vmin red, 5vmin 2vmin red, 6vmin 2vmin, 7vmin 2vmin, 8vmin 2vmin red, 9vmin 2vmin red, 10vmin 2vmin red, 11vmin 2vmin black,
2vmin 3vmin black, 3vmin 3vmin red, 4vmin 3vmin red, 5vmin 3vmin red, 6vmin 3vmin, 7vmin 3vmin, 8vmin 3vmin red, 9vmin 3vmin red, 10vmin 3vmin red, 11vmin 3vmin black,
1vmin 4vmin black, 2vmin 4vmin red, 3vmin 4vmin red, 4vmin 4vmin red, 5vmin 4vmin red, 6vmin 4vmin red, 7vmin 4vmin red, 8vmin 4vmin red, 9vmin 4vmin red, 10vmin 4vmin red, 11vmin 4vmin red, 12vmin 4vmin black,
1vmin 5vmin black, 2vmin 5vmin red, 3vmin 5vmin red, 4vmin 5vmin red, 5vmin 5vmin red, 6vmin 5vmin red, 7vmin 5vmin red, 8vmin 5vmin red, 9vmin 5vmin red, 10vmin 5vmin red, 11vmin 5vmin red, 12vmin 5vmin black,
1vmin 6vmin black, 2vmin 6vmin, 3vmin 6vmin, 4vmin 6vmin red, 5vmin 6vmin red, 6vmin 6vmin red, 7vmin 6vmin red, 8vmin 6vmin red, 9vmin 6vmin red, 10vmin 6vmin, 11vmin 6vmin, 12vmin 6vmin black,
1vmin 7vmin black, 2vmin 7vmin, 3vmin 7vmin, 4vmin 7vmin, 5vmin 7vmin, 6vmin 7vmin, 7vmin 7vmin, 8vmin 7vmin, 9vmin 7vmin, 10vmin 7vmin, 11vmin 7vmin, 12vmin 7vmin black,
2vmin 8vmin black, 3vmin 8vmin, 4vmin 8vmin, 5vmin 8vmin, 6vmin 8vmin, 7vmin 8vmin, 8vmin 8vmin, 9vmin 8vmin, 10vmin 8vmin, 11vmin 8vmin black,
2vmin 9vmin black, 3vmin 9vmin, 4vmin 9vmin, 5vmin 9vmin, 6vmin 9vmin, 7vmin 9vmin, 8vmin 9vmin, 9vmin 9vmin, 10vmin 9vmin, 11vmin 9vmin black,
3vmin 10vmin black, 4vmin 10vmin black, 5vmin 10vmin, 6vmin 10vmin, 7vmin 10vmin, 8vmin 10vmin, 9vmin 10vmin black, 10vmin 10vmin black,
5vmin 11vmin black, 6vmin 11vmin black, 7vmin 11vmin black, 8vmin 11vmin black;
}
.pokeball::after {
content: '';
position: absolute;
width: 1250%;
height: 1250%;
}
.pokeball:hover {
animation-name: shake;
animation-duration: 2s;
}
#first {
top: -18vmin;
left: -28vmin;
transform: scale(1.3, 1.3);
}
#second {
top: -19vmin;
left: -9vmin;
transform: scale(1.3, 1.3);
}
#third {
top: -20vmin;
left: 11vmin;
transform: scale(1.3, 1.3);
}
.ash {
position: relative;
height: 1vmin;
width: 1vmin;
background: transparent;
color: black;
top: -56vmin;
left: -10vmin;
transform: scale(1.3, 1.3);
box-shadow:
5vmin 0, 6vmin 0, 7vmin 0, 8vmin 0, 9vmin 0, 10vmin 0,
3vmin 1vmin, 4vmin 1vmin, 5vmin 1vmin #999999, 6vmin 1vmin #999999, 7vmin 1vmin #999999, 8vmin 1vmin #999999, 9vmin 1vmin #999999, 10vmin 1vmin #999999, 11vmin 1vmin, 12vmin 1vmin,
3vmin 2vmin, 4vmin 2vmin #999999, 5vmin 2vmin #999999, 6vmin 2vmin #999999, 7vmin 2vmin #999999, 8vmin 2vmin #999999, 9vmin 2vmin #999999, 10vmin 2vmin #999999, 11vmin 2vmin #999999, 12vmin 2vmin,
3vmin 3vmin, 4vmin 3vmin #999999, 5vmin 3vmin #999999, 6vmin 3vmin #999999, 7vmin 3vmin #999999, 8vmin 3vmin #999999, 9vmin 3vmin #999999, 10vmin 3vmin #999999, 11vmin 3vmin #999999, 12vmin 3vmin,
2vmin 4vmin, 3vmin 4vmin, 4vmin 4vmin, 5vmin 4vmin #999999, 6vmin 4vmin white, 7vmin 4vmin white, 8vmin 4vmin white, 9vmin 4vmin white, 10vmin 4vmin #999999, 11vmin 4vmin, 12vmin 4vmin, 13vmin 4vmin,
2vmin 5vmin, 3vmin 5vmin, 4vmin 5vmin white, 5vmin 5vmin, 6vmin 5vmin, 7vmin 5vmin, 8vmin 5vmin, 9vmin 5vmin, 10vmin 5vmin, 11vmin 5vmin white, 12vmin 5vmin, 13vmin 5vmin,
1vmin 6vmin, 2vmin 6vmin white, 3vmin 6vmin, 4vmin 6vmin white, 5vmin 6vmin white, 6vmin 6vmin white, 7vmin 6vmin white, 8vmin 6vmin white, 9vmin 6vmin white, 10vmin 6vmin white, 11vmin 6vmin white, 12vmin 6vmin, 13vmin 6vmin white, 14vmin 6vmin,
1vmin 7vmin, 2vmin 7vmin white, 3vmin 7vmin white, 4vmin 7vmin white, 5vmin 7vmin white, 6vmin 7vmin, 7vmin 7vmin white, 8vmin 7vmin white, 9vmin 7vmin, 10vmin 7vmin white, 11vmin 7vmin white, 12vmin 7vmin white, 13vmin 7vmin white, 14vmin 7vmin,
2vmin 8vmin, 3vmin 8vmin, 4vmin 8vmin white, 5vmin 8vmin white, 6vmin 8vmin, 7vmin 8vmin white, 8vmin 8vmin white, 9vmin 8vmin, 10vmin 8vmin white, 11vmin 8vmin white, 12vmin 8vmin, 13vmin 8vmin,
2vmin 9vmin, 3vmin 9vmin, 4vmin 9vmin, 5vmin 9vmin white, 6vmin 9vmin white, 7vmin 9vmin #999999, 8vmin 9vmin #999999, 9vmin 9vmin white, 10vmin 9vmin white, 11vmin 9vmin, 12vmin 9vmin, 13vmin 9vmin,
1vmin 10vmin, 2vmin 10vmin white, 3vmin 10vmin white, 4vmin 10vmin, 5vmin 10vmin, 6vmin 10vmin, 7vmin 10vmin, 8vmin 10vmin, 9vmin 10vmin, 10vmin 10vmin, 11vmin 10vmin, 12vmin 10vmin white, 13vmin 10vmin white, 14vmin 10vmin,
1vmin 11vmin, 2vmin 11vmin white, 3vmin 11vmin white, 4vmin 11vmin, 5vmin 11vmin, 6vmin 11vmin, 7vmin 11vmin, 8vmin 11vmin, 9vmin 11vmin, 10vmin 11vmin, 11vmin 11vmin, 12vmin 11vmin white, 13vmin 11vmin white, 14vmin 11vmin,
2vmin 12vmin, 3vmin 12vmin, 4vmin 12vmin, 5vmin 12vmin #999999, 6vmin 12vmin #999999, 7vmin 12vmin, 8vmin 12vmin, 9vmin 12vmin #999999, 10vmin 12vmin #999999, 11vmin 12vmin, 12vmin 12vmin, 13vmin 12vmin,
3vmin 13vmin, 4vmin 13vmin #999999, 5vmin 13vmin, 6vmin 13vmin, 7vmin 13vmin #999999, 8vmin 13vmin #999999, 9vmin 13vmin, 10vmin 13vmin, 11vmin 13vmin #999999, 12vmin 13vmin,
3vmin 14vmin, 4vmin 14vmin #999999, 5vmin 14vmin #999999, 6vmin 14vmin #999999, 7vmin 14vmin, 8vmin 14vmin, 9vmin 14vmin #999999, 10vmin 14vmin #999999, 11vmin 14vmin #999999, 12vmin 14vmin,
4vmin 15vmin, 5vmin 15vmin, 6vmin 15vmin, 7vmin 15vmin #6E6E6E, 8vmin 15vmin #6E6E6E, 9vmin 15vmin, 10vmin 15vmin, 11vmin 15vmin
}
@keyframes shake {
25% {
transform: rotate(-90deg);
transform: scale(1.3, 1.3);
transform-origin: 6vmin 6vmin;
}
50% {
transform: scale(1.5, 1.5);
}
}
@keyframes int {
25% {
top: 2vmin;
}
}
Also see: Tab Triggers