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="wrap">
<!--<h1>CSS Loading Animations</h1>-->
<div class="load-1 loading-1">
</div>
<div class="load-2">
<div></div>
<div></div>
<div></div>
<div></div>
</div>
<div class="load-3">
<div></div>
<div></div>
<div></div>
<div></div>
</div>
<div class="load-4">
<div></div>
<div></div>
<div></div>
<div></div>
</div>
<div class="load-5">
<div></div>
<div></div>
<div></div>
</div>
<div class="load-6">
<div>
<div></div>
</div>
</div>
</div>
body
background: #003c5d
font-family: 'Open Sans', sans-serif
padding: 50px
.wrap
margin-bottom: 100px
padding-bottom: 100px
text-align: center
vertical-align: middle
h1
color: #fff
display: block
letter-spacing: 3px
padding: 30px
font-weight: 100
.load-1
background: rgba(5, 124, 255, 1)
border-radius: 50%
display: inline-block
height: 50px
margin: 50px
position: relative
width: 50px
animation: load-1-animation 1.5s linear infinite
&:after, &:before
content: ''
display: block
width: 50px
height: 50px
border-radius: 50%
.loading-1:after
position: absolute
top: -10px
left: -10px
border: 10px solid transparent
border-top-color: rgba(5, 124, 255, 1)
border-bottom-color: rgba(5, 124, 255, 1)
animation: loading-1-animation 1.5s linear infinite
.load-2
border-radius: 50%
display: inline-block
height: 50px
margin: 50px
position: relative
width: 50px
.load-2>div:nth-child(1)
width: 20px
height: 20px
position: relative
top: 13px
left: 13px
background: rgba(5, 124, 255, 1)
border: 2px solid #FFF
border-radius: 50%
z-index: 1000
.load-2>div:nth-child(2), .load-2>div:nth-child(3), .load-2>div:nth-child(4)
width: 100px
height: 100px
position: absolute
top: -25px
left: -25px
display: block
background: rgba(5, 124, 255, 0.4)
border-radius: 50%
opacity: 0
animation: load-2-animation 2400ms ease-out infinite
.load-2>div:nth-child(3)
animation-delay: .4s
.load-2>div:nth-child(4)
animation-delay: .8s
.load-3
display: inline-block
height: 50px
margin: 50px
position: relative
top: -15px
width: 50px
//top: -50px
.load-3>div
width: 50px
height: 50px
position: absolute
//top: -30px
left: 0
//display: inline-block
background: rgba(5, 124, 255, 1)
border-radius: 50%
opacity: .2
.load-3>div:nth-child(1)
width: 25px
height: 25px
left: -2px
top: 38px
opacity: .8
animation: load-3-animation 2s ease-in-out infinite
animation-delay: 2s
z-index: 1000
.load-3>div:nth-child(2)
left: -15px
top: 25px
//animation: load-2-animation 2400ms ease-out infinite
//animation-delay: 6s
opacity: 0
//top: 0
.load-3>div:nth-child(3)
left: 15px
top: 25px
//animation: loading-3-animation 2400ms ease-out infinite
//animation-delay: 4s
opacity: 0
//left: 45px
.load-3>div:nth-child(4)
//animation: loading-3-animation 2400ms ease-out infinite
opacity: 0
//left: 45px
.load-4
//background: rgba(5, 124, 255, 1)
//border-radius: 50%
display: inline-block
height: 50px
margin: 50px
position: relative
top: -15px
width: 50px
//top: -50
.load-4>div
width: 50px
height: 50px
position: absolute
//top: -30px
left: 0
//display: inline-block
background: rgba(5, 124, 255, 1)
border-radius: 50%
opacity: .2
animation: load-2-animation 2400ms ease-out infinite
.load-4>div:nth-child(1)
left: -15px
top: 25px
.load-4>div:nth-child(2)
left: -15px
top: 25px
//opacity: .4
//top: 0
.load-4>div:nth-child(3)
left: 15px
top: 25px
//opacity: .6
//left: 45px
.load-5
display: inline-block
height: 50px
margin: 50px
position: relative
//top: -15px
width: 50px
.load-5>div
width: 50px
height: 50px
position: absolute
left: 0
//opacity: .2
border: 4px solid rgba(5, 124, 255, 1)
//transform: rotate(45deg)
animation: load-5-1 1.5s infinite ease-in-out
.load-5>div:nth-child(1)
width: 30px
height: 30px
//position: relative
top: 10px
left: 10px
//opacity: .5
animation: load-5-2 1.5s infinite ease-in-out
.load-5>div:nth-child(2)
width: 10px
height: 10px
//position: relative
background: rgba(5, 124, 255, 1)
top: 20px
left: 20px
//opacity: 1
animation: load-5-3 3s infinite ease-in-out
.load-6
display: inline-block
height: 50px
margin: 50px
opacity: 0.75
position: relative
width: 50px
top: -50px
left: 0
animation: load-6-animation 500ms linear infinite
.load-6>div:nth-child(1)
overflow: hidden
background: none
position: relative
height: 50px
width: 25px
top: 0
left: 0
.load-6>div>div:nth-child(1)
background: none
box-sizing: border-box
border: 10px solid rgba(5, 124, 255, 1)
border-left-color: transparent
border-right-color: transparent
border-radius: 50%
height: 50px
width: 50px
animation: loading-6-animation 1000ms cubic-bezier(.2,0,.30,1) infinite
@keyframes load-1-animation
0%
opacity: 1
transform: scale(.4)
50%
opacity: .5
transform: scale(1)
100%
opacity: 1
transform: scale(.4)
@keyframes loading-1-animation
0%
opacity: 1
transform: rotate(0deg) scale(1.1)
50%
opacity: .35
transform: rotate(45deg) scale(1.6 )
100%
opacity: 1
transform: rotate(360deg) scale(1.1)
@keyframes load-2-animation
0%
transform: scale(0.1)
opacity: 0
50%
opacity: 1
100%
transform: scale(1.2)
opacity: 0
@keyframes load-3-animation
0%
opacity: .8
transform: translate(0,0)
33%
//opacity: .35
transform: translate(30px,0)
66%
//opacity: .35
transform: translate(16px,-26px)
100%
opacity: .8
transform: translate(0,0)
@keyframes loading-3-animation
0%
transform: scale(0.1)
opacity: 0
50%
opacity: 1
100%
transform: scale(1.2)
opacity: 0
@keyframes load-4-animation
0%
opacity: 1
transform: rotate(0deg) scale(1.1)
50%
opacity: .35
transform: rotate(45deg) scale(1.6 )
100%
opacity: 1
transform: rotate(360deg) scale(1.1)
@keyframes load-5-1
0%
transform: perspective(100px) rotatex(0deg) rotatey(0deg)
50%
transform: perspective(100px) rotatex(180deg) rotatey(0deg)
100%
transform: perspective(100px) rotatex(180deg) rotatey(180deg)
@keyframes load-5-2
0%
transform: perspective(200px) rotatex(0deg) rotatey(0deg)
50%
transform: perspective(200px) rotatex(-180deg) rotatey(0deg)
100%
transform: perspective(200px) rotatex(-180deg) rotatey(-180deg)
@keyframes load-5-3
0%
transform: perspective(300px) rotatex(0deg) rotatey(0deg)
50%
transform: perspective(300px) rotatex(0deg) rotatey(0deg)
100%
transform: perspective(300px) rotatex(180deg) rotatey(180deg)
@keyframes load-6-animation
0%
transform: rotate(0deg)
100%
transform: rotate(360deg)
@keyframes loading-6-animation
0%
transform: rotate(0)
50%
transform: rotate(-140deg)
100%
transform: rotate(0)
Also see: Tab Triggers