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="loading-container">
<div class="loading">
<?xml version="1.0" encoding="UTF-8"?>
<svg width="167px" height="167px" viewBox="0 0 167 167" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 61.2 (89653) - https://sketch.com -->
<title>未命名</title>
<desc>Created with Sketch.</desc>
<defs>
<linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="linearGradient-1">
<stop stop-color="#EA3252" offset="0%"></stop>
<stop stop-color="#FFD2AE" offset="100%"></stop>
</linearGradient>
</defs>
<g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M83.5,0 C129.615777,0 167,37.3842234 167,83.5 C167,129.615777 129.615777,167 83.5,167 C37.3842234,167 0,129.615777 0,83.5 C0,37.3842234 37.3842234,0 83.5,0 Z M84,7 C41.4740743,7 7,41.4740743 7,84 C7,126.525926 41.4740743,161 84,161 C126.525926,161 161,126.525926 161,84 C161,41.4740743 126.525926,7 84,7 Z" id="形状结合备份-2" fill="url(#linearGradient-1)"></path>
</g>
</svg>
</div>
<div id="loading-text">
<?xml version="1.0" encoding="UTF-8"?>
<svg width="199px" height="199px" viewBox="0 0 199 199" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 61.2 (89653) - https://sketch.com -->
<title>ico</title>
<desc>Created with Sketch.</desc>
<defs>
<linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="linearGradient-1">
<stop stop-color="#EA3152" offset="0%"></stop>
<stop stop-color="#E7BE9D" offset="100%"></stop>
</linearGradient>
<linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="linearGradient-2">
<stop stop-color="#EA3152" offset="0%"></stop>
<stop stop-color="#E7BF9D" offset="100%"></stop>
</linearGradient>
</defs>
<g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="编组-4备份-4" transform="translate(2.000000, 9.000000)">
<path d="M111.5,2.84217094e-13 C117.586005,2.84217094e-13 121.756479,1.99465929 124.011422,5.98397787 L193.769006,115.56269 C195.764672,121.593407 195.333834,126.610849 192.476493,130.615017 C189.619152,134.619185 185.335564,137.080846 179.62573,138 L42.3609254,138 C36.3750477,137.763123 32.1860847,135.301462 29.7940363,130.615017 C27.4019879,125.928572 27.4019879,120.461474 29.7940363,114.213722 L98.0152353,5.98397787 C100.919073,1.99465929 105.413995,2.84217094e-13 111.5,2.84217094e-13 Z M111.022468,25.0151492 C106.621596,25.0151492 103.371257,26.4614303 101.271453,29.3539926 L101.271453,29.3539926 L51.9397832,107.828868 C50.2100607,112.358968 50.2100607,116.323034 51.9397832,119.721066 C53.6695057,123.119099 56.6986014,124.903992 61.0270703,125.075746 L61.0270703,125.075746 L160.285103,125.075746 C164.413961,124.409289 167.511481,122.624396 169.577663,119.721066 C171.643845,116.817737 171.95539,113.179706 170.512297,108.806973 L170.512297,108.806973 L120.069646,29.3539926 C118.439067,26.4614303 115.423341,25.0151492 111.022468,25.0151492 Z" id="形状结合备份" fill="url(#linearGradient-1)"></path>
<path d="M83.5,43 C89.5860054,43 93.7564794,44.9946593 96.0114221,48.9839779 L165.769006,158.56269 C167.764672,164.593407 167.333834,169.610849 164.476493,173.615017 C161.619152,177.619185 157.335564,180.080846 151.62573,181 L14.3609254,181 C8.37504774,180.763123 4.18608471,178.301462 1.7940363,173.615017 C-0.598012101,168.928572 -0.598012101,163.461474 1.7940363,157.213722 L70.0152353,48.9839779 C72.919073,44.9946593 77.4139946,43 83.5,43 Z M83.0224683,68.0151492 C78.6215957,68.0151492 75.3712572,69.4614303 73.2714529,72.3539926 L73.2714529,72.3539926 L23.9397832,150.828868 C22.2100607,155.358968 22.2100607,159.323034 23.9397832,162.721066 C25.6695057,166.119099 28.6986014,167.903992 33.0270703,168.075746 L33.0270703,168.075746 L132.285103,168.075746 C136.413961,167.409289 139.511481,165.624396 141.577663,162.721066 C143.643845,159.817737 143.95539,156.179706 142.512297,151.806973 L142.512297,151.806973 L92.0696465,72.3539926 C90.439067,69.4614303 87.4233409,68.0151492 83.0224683,68.0151492 Z" id="形状结合" fill="url(#linearGradient-2)"></path>
</g>
<rect id="矩形" x="0" y="0" width="199" height="199"></rect>
</g>
</svg>
</div>
</div>
<!--// Link Attribution -->
<a href="http://www.domsammut.com/about#utm_source=web&utm_medium=demo&utm_campaign=CodePen" title="domsammut.com" id="link">powered by popIn Action</a>
#link {color: #FF5078;display:block;font: 12px "Helvetica Neue", Helvetica, Arial, sans-serif;text-align:center; text-decoration: none;}
#link:hover {color: #CCCCCC}
#link, #link:hover {-webkit-transition: color 0.5s ease-out;-moz-transition: color 0.5s ease-out;-ms-transition: color 0.5s ease-out;-o-transition: color 0.5s ease-out;transition: color 0.5s ease-out;}
/** BEGIN CSS **/
body {background: #333333;}
@keyframes rotate-loading {
0% {transform: rotate(0deg);-ms-transform: rotate(0deg); -webkit-transform: rotate(0deg); -o-transform: rotate(0deg); -moz-transform: rotate(0deg);}
100% {transform: rotate(360deg);-ms-transform: rotate(360deg); -webkit-transform: rotate(360deg); -o-transform: rotate(360deg); -moz-transform: rotate(360deg);}
}
@-moz-keyframes rotate-loading {
0% {transform: rotate(0deg);-ms-transform: rotate(0deg); -webkit-transform: rotate(0deg); -o-transform: rotate(0deg); -moz-transform: rotate(0deg);}
100% {transform: rotate(360deg);-ms-transform: rotate(360deg); -webkit-transform: rotate(360deg); -o-transform: rotate(360deg); -moz-transform: rotate(360deg);}
}
@-webkit-keyframes rotate-loading {
0% {transform: rotate(0deg);-ms-transform: rotate(0deg); -webkit-transform: rotate(0deg); -o-transform: rotate(0deg); -moz-transform: rotate(0deg);}
100% {transform: rotate(360deg);-ms-transform: rotate(360deg); -webkit-transform: rotate(360deg); -o-transform: rotate(360deg); -moz-transform: rotate(360deg);}
}
@-o-keyframes rotate-loading {
0% {transform: rotate(0deg);-ms-transform: rotate(0deg); -webkit-transform: rotate(0deg); -o-transform: rotate(0deg); -moz-transform: rotate(0deg);}
100% {transform: rotate(360deg);-ms-transform: rotate(360deg); -webkit-transform: rotate(360deg); -o-transform: rotate(360deg); -moz-transform: rotate(360deg);}
}
@keyframes rotate-loading {
0% {transform: rotate(0deg);-ms-transform: rotate(0deg); -webkit-transform: rotate(0deg); -o-transform: rotate(0deg); -moz-transform: rotate(0deg);}
100% {transform: rotate(360deg);-ms-transform: rotate(360deg); -webkit-transform: rotate(360deg); -o-transform: rotate(360deg); -moz-transform: rotate(360deg);}
}
@-moz-keyframes rotate-loading {
0% {transform: rotate(0deg);-ms-transform: rotate(0deg); -webkit-transform: rotate(0deg); -o-transform: rotate(0deg); -moz-transform: rotate(0deg);}
100% {transform: rotate(360deg);-ms-transform: rotate(360deg); -webkit-transform: rotate(360deg); -o-transform: rotate(360deg); -moz-transform: rotate(360deg);}
}
@-webkit-keyframes rotate-loading {
0% {transform: rotate(0deg);-ms-transform: rotate(0deg); -webkit-transform: rotate(0deg); -o-transform: rotate(0deg); -moz-transform: rotate(0deg);}
100% {transform: rotate(360deg);-ms-transform: rotate(360deg); -webkit-transform: rotate(360deg); -o-transform: rotate(360deg); -moz-transform: rotate(360deg);}
}
@-o-keyframes rotate-loading {
0% {transform: rotate(0deg);-ms-transform: rotate(0deg); -webkit-transform: rotate(0deg); -o-transform: rotate(0deg); -moz-transform: rotate(0deg);}
100% {transform: rotate(360deg);-ms-transform: rotate(360deg); -webkit-transform: rotate(360deg); -o-transform: rotate(360deg); -moz-transform: rotate(360deg);}
}
@keyframes loading-text-opacity {
0% {opacity: 1}
30% {opacity: 1}
50% {opacity: 0}
80% {opacity: 0}
100%{opacity: 1}
}
@-moz-keyframes loading-text-opacity {
0% {opacity: 1}
30% {opacity: 1}
50% {opacity: 0}
80% {opacity: 0}
100%{opacity: 1}
}
@-webkit-keyframes loading-text-opacity {
0% {opacity: 1}
30% {opacity: 1}
50% {opacity: 0}
80% {opacity: 0}
100%{opacity: 1}
}
@-o-keyframes loading-text-opacity {
0% {opacity: 1}
30% {opacity: 1}
50% {opacity: 0}
80% {opacity: 0}
100%{opacity: 1}
}
.loading-container,
.loading {
height: 100px;
position: relative;
width: 100px;
border-radius: 100%;
}
.loading-container { margin: 40px auto;}
.loading {
-moz-animation: rotate-loading 1.5s linear 0s infinite normal;
-moz-transform-origin: 50% 50%;
-o-animation: rotate-loading 1.5s linear 0s infinite normal;
-o-transform-origin: 50% 50%;
-webkit-animation: rotate-loading 1.5s linear 0s infinite normal;
-webkit-transform-origin: 50% 50%;
animation: rotate-loading 1.5s linear 0s infinite normal;
transform-origin: 50% 50%;
}
.loading svg{
height:100%;
width: 100%;
}
.loading-container:hover .loading,
.loading-container .loading {
-webkit-transition: all 0.5s ease-in-out;
-moz-transition: all 0.5s ease-in-out;
-ms-transition: all 0.5s ease-in-out;
-o-transition: all 0.5s ease-in-out;
transition: all 0.5s ease-in-out;
}
#loading-text {
-moz-animation: loading-text-opacity 2s linear 0s infinite normal;
-o-animation: loading-text-opacity 2s linear 0s infinite normal;
-webkit-animation: loading-text-opacity 2s linear 0s infinite normal;
animation: loading-text-opacity 2s linear 0s infinite normal;
color: #ffffff;
font-family: "Helvetica Neue, "Helvetica", ""arial";
font-size: 10px;
font-weight: bold;
opacity: 0;
position: absolute;
text-align: center;
text-transform: uppercase;
top: 0;
width: 100px;
}
#loading-text svg{
width: 50%;
height: auto;
margin: 20px 0 0 1px;
}
/*
Dom Sammut 2013
***************
Web: www.domsammut.com
Twitter: www.twitter.com/domsammut
View codepen on my website: https://www.domsammut.com/projects/pure-css-loading-animation
*/
Also see: Tab Triggers