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.
<div class="linear">
linear
</div>
<div class="ease-in-out">
ease-in-out
</div>
.linear{
width: 400px;
text-align: center;
animation: 2s linear 0s infinite normal none running animation;
}
.ease-in-out{
width: 400px;
text-align: center;
animation: 2s ease-in-out 0s infinite normal none running animation;
}
@keyframes animation {
1% {
background: linear-gradient(to right, #ffcc99 0%, #efefef 7.857142857142858%)
}
2% {
background: linear-gradient(to right, #ffcc99 0.7142857142857144%, #efefef 10.714285714285715%)
}
3% {
background: linear-gradient(to right, #ffcc99 3.571428571428571%, #efefef 13.571428571428571%)
}
4% {
background: linear-gradient(to right, #ffcc99 6.428571428571429%, #efefef 16.42857142857143%)
}
5% {
background: linear-gradient(to right, #ffcc99 9.285714285714286%, #efefef 19.285714285714285%)
}
6% {
background: linear-gradient(to right, #ffcc99 12.142857142857142%, #efefef 22.142857142857142%)
}
7% {
background: linear-gradient(to right, #ffcc99 15.0%, #efefef 25.0%)
}
8% {
background: linear-gradient(to right, #ffcc99 17.857142857142858%, #efefef 27.857142857142858%)
}
9% {
background: linear-gradient(to right, #ffcc99 20.714285714285715%, #efefef 30.714285714285715%)
}
10% {
background: linear-gradient(to right, #ffcc99 23.571428571428573%, #efefef 33.57142857142857%)
}
11% {
background: linear-gradient(to right, #ffcc99 26.42857142857143%, #efefef 36.42857142857143%)
}
12% {
background: linear-gradient(to right, #ffcc99 29.285714285714285%, #efefef 39.285714285714285%)
}
13% {
background: linear-gradient(to right, #ffcc99 32.142857142857146%, #efefef 42.142857142857146%)
}
14% {
background: linear-gradient(to right, #ffcc99 35.0%, #efefef 45.0%)
}
15% {
background: linear-gradient(to right, #ffcc99 37.85714285714286%, #efefef 47.85714285714286%)
}
16% {
background: linear-gradient(to right, #ffcc99 40.714285714285715%, #efefef 50.714285714285715%)
}
17% {
background: linear-gradient(to right, #ffcc99 43.57142857142857%, #efefef 53.57142857142857%)
}
18% {
background: linear-gradient(to right, #ffcc99 46.42857142857143%, #efefef 56.42857142857143%)
}
19% {
background: linear-gradient(to right, #ffcc99 49.285714285714285%, #efefef 59.285714285714285%)
}
20% {
background: linear-gradient(to right, #ffcc99 52.142857142857146%, #efefef 62.142857142857146%)
}
21% {
background: linear-gradient(to right, #ffcc99 55.0%, #efefef 65.0%)
}
22% {
background: linear-gradient(to right, #ffcc99 57.85714285714286%, #efefef 67.85714285714286%)
}
23% {
background: linear-gradient(to right, #ffcc99 60.71428571428572%, #efefef 70.71428571428572%)
}
24% {
background: linear-gradient(to right, #ffcc99 63.57142857142857%, #efefef 73.57142857142857%)
}
25% {
background: linear-gradient(to right, #ffcc99 66.42857142857143%, #efefef 76.42857142857143%)
}
26% {
background: linear-gradient(to right, #ffcc99 69.28571428571429%, #efefef 79.28571428571429%)
}
27% {
background: linear-gradient(to right, #ffcc99 72.14285714285714%, #efefef 82.14285714285714%)
}
28% {
background: linear-gradient(to right, #ffcc99 75.0%, #efefef 85.0%)
}
29% {
background: linear-gradient(to right, #ffcc99 77.85714285714286%, #efefef 87.85714285714286%)
}
30% {
background: linear-gradient(to right, #ffcc99 80.71428571428572%, #efefef 90.71428571428572%)
}
31% {
background: linear-gradient(to right, #ffcc99 83.57142857142857%, #efefef 93.57142857142857%)
}
32% {
background: linear-gradient(to right, #ffcc99 86.42857142857143%, #efefef 96.42857142857143%)
}
33% {
background: linear-gradient(to right, #ffcc99 89.28571428571429%, #efefef 99.28571428571429%)
}
34% {
background: linear-gradient(to right, #ffcc99 92.14285714285714%, #efefef 100%)
}
35% {
background: linear-gradient(to right, #ffcc99 95.0%, #efefef 100%)
}
36% {
background: linear-gradient(to right, #ffcc99 100%, #efefef 100%)
}
37% {
background: linear-gradient(to right, #ffcc99 100%, #efefef 100%)
}
38% {
background: linear-gradient(to right, #ffcc99 100%, #efefef 100%)
}
39% {
background: linear-gradient(to right, #ffcc99 100%, #efefef 100%)
}
40% {
background: linear-gradient(to right, #ffcc99 100%, #efefef 100%)
}
41% {
background: linear-gradient(to right, #ffcc99 100%, #efefef 100%)
}
42% {
background: linear-gradient(to right, #ffcc99 100%, #efefef 100%)
}
43% {
background: linear-gradient(to right, #ffcc99 100%, #efefef 100%)
}
44% {
background: linear-gradient(to right, #ffcc99 100%, #efefef 100%)
}
45% {
background: linear-gradient(to right, #ffcc99 100%, #efefef 100%)
}
46% {
background: linear-gradient(to right, #ffcc99 100%, #efefef 100%)
}
47% {
background: linear-gradient(to right, #ffcc99 100%, #efefef 100%)
}
48% {
background: linear-gradient(to right, #ffcc99 100%, #efefef 100%)
}
49% {
background: linear-gradient(to right, #ffcc99 100%, #efefef 100%)
}
50% {
background: linear-gradient(to right, #ffcc99 100%, #efefef 100%)
}
51% {
background: linear-gradient(to right, #ffcc99 100%, #efefef 100%)
}
52% {
background: linear-gradient(to right, #ffcc99 100%, #efefef 100%)
}
53% {
background: linear-gradient(to right, #ffcc99 100%, #efefef 100%)
}
54% {
background: linear-gradient(to right, #ffcc99 100%, #efefef 100%)
}
55% {
background: linear-gradient(to right, #ffcc99 100%, #efefef 100%)
}
56% {
background: linear-gradient(to right, #ffcc99 100%, #efefef 100%)
}
57% {
background: linear-gradient(to right, #ffcc99 100%, #efefef 100%)
}
58% {
background: linear-gradient(to right, #ffcc99 100%, #efefef 100%)
}
59% {
background: linear-gradient(to right, #ffcc99 100%, #efefef 100%)
}
60% {
background: linear-gradient(to right, #ffcc99 100%, #efefef 100%)
}
61% {
background: linear-gradient(to right, #ffcc99 100%, #efefef 100%)
}
62% {
background: linear-gradient(to right, #ffcc99 100%, #efefef 100%)
}
63% {
background: linear-gradient(to right, #ffcc99 100%, #efefef 100%)
}
64% {
background: linear-gradient(to right, #ffcc99 100%, #efefef 100%)
}
65% {
background: linear-gradient(to right, #ffcc99 100%, #efefef 100%)
}
66% {
background: linear-gradient(to right, #efefef 0%, #ffcc99 7.857142857142858%)
}
67% {
background: linear-gradient(to right, #efefef 0.7142857142857144%, #ffcc99 10.714285714285715%)
}
68% {
background: linear-gradient(to right, #efefef 3.571428571428571%, #ffcc99 13.571428571428571%)
}
69% {
background: linear-gradient(to right, #efefef 6.428571428571429%, #ffcc99 16.42857142857143%)
}
70% {
background: linear-gradient(to right, #efefef 9.285714285714286%, #ffcc99 19.285714285714285%)
}
71% {
background: linear-gradient(to right, #efefef 12.142857142857142%, #ffcc99 22.142857142857142%)
}
72% {
background: linear-gradient(to right, #efefef 15.0%, #ffcc99 25.0%)
}
73% {
background: linear-gradient(to right, #efefef 17.857142857142858%, #ffcc99 27.857142857142858%)
}
74% {
background: linear-gradient(to right, #efefef 20.714285714285715%, #ffcc99 30.714285714285715%)
}
75% {
background: linear-gradient(to right, #efefef 23.571428571428573%, #ffcc99 33.57142857142857%)
}
76% {
background: linear-gradient(to right, #efefef 26.42857142857143%, #ffcc99 36.42857142857143%)
}
77% {
background: linear-gradient(to right, #efefef 29.285714285714285%, #ffcc99 39.285714285714285%)
}
78% {
background: linear-gradient(to right, #efefef 32.142857142857146%, #ffcc99 42.142857142857146%)
}
79% {
background: linear-gradient(to right, #efefef 35.0%, #ffcc99 45.0%)
}
80% {
background: linear-gradient(to right, #efefef 37.85714285714286%, #ffcc99 47.85714285714286%)
}
81% {
background: linear-gradient(to right, #efefef 40.714285714285715%, #ffcc99 50.714285714285715%)
}
82% {
background: linear-gradient(to right, #efefef 43.57142857142857%, #ffcc99 53.57142857142857%)
}
83% {
background: linear-gradient(to right, #efefef 46.42857142857143%, #ffcc99 56.42857142857143%)
}
84% {
background: linear-gradient(to right, #efefef 49.285714285714285%, #ffcc99 59.285714285714285%)
}
85% {
background: linear-gradient(to right, #efefef 52.142857142857146%, #ffcc99 62.142857142857146%)
}
86% {
background: linear-gradient(to right, #efefef 55.0%, #ffcc99 65.0%)
}
87% {
background: linear-gradient(to right, #efefef 57.85714285714286%, #ffcc99 67.85714285714286%)
}
88% {
background: linear-gradient(to right, #efefef 60.71428571428572%, #ffcc99 70.71428571428572%)
}
89% {
background: linear-gradient(to right, #efefef 63.57142857142857%, #ffcc99 73.57142857142857%)
}
90% {
background: linear-gradient(to right, #efefef 66.42857142857143%, #ffcc99 76.42857142857143%)
}
91% {
background: linear-gradient(to right, #efefef 69.28571428571429%, #ffcc99 79.28571428571429%)
}
92% {
background: linear-gradient(to right, #efefef 72.14285714285714%, #ffcc99 82.14285714285714%)
}
93% {
background: linear-gradient(to right, #efefef 75.0%, #ffcc99 85.0%)
}
94% {
background: linear-gradient(to right, #efefef 77.85714285714286%, #ffcc99 87.85714285714286%)
}
95% {
background: linear-gradient(to right, #efefef 80.71428571428572%, #ffcc99 90.71428571428572%)
}
96% {
background: linear-gradient(to right, #efefef 83.57142857142857%, #ffcc99 93.57142857142857%)
}
97% {
background: linear-gradient(to right, #efefef 86.42857142857143%, #ffcc99 96.42857142857143%)
}
98% {
background: linear-gradient(to right, #efefef 89.28571428571429%, #ffcc99 99.28571428571429%)
}
99% {
background: linear-gradient(to right, #efefef 92.14285714285714%, #ffcc99 100%)
}
100% {
background: linear-gradient(to right, #efefef 95.0%, #ffcc99 100%)
}
}
Also see: Tab Triggers