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.
<!-- Edit --TW to adjust spacing.
Edit --AD to adjust scroll speed. -->
<section>
<!-- Begin Actual Code For Marquee-->
<a href="https://isotropic.co/blog"><div class="marquee marquee--long isotropic-cool-bg" style="--tw: 30.5ch; --ad: 4s;">
<span>Read our WordPress blog -</span>
</div>
</a>
<!-- End Actual Code For Marquee-->
<section>
.marquee {
margin:0;
font-size: 8vw;
overflow: hidden;
background:#f57c00;
text-transform:uppercase;
padding:15px 0;
}
.marquee--long {
font-size: 14px;
}
.marquee span {
display: inline-block;
white-space: nowrap;
color: white;
width: var(--tw);
text-shadow: var(--tw) 0 currentColor,
calc(var(--tw) * 2) 0 currentColor,
calc(var(--tw) * 3) 0 currentColor,
calc(var(--tw) * 4) 0 currentColor,
calc(var(--tw) * 5) 0 currentColor,
calc(var(--tw) * 6) 0 currentColor,
calc(var(--tw) * 7) 0 currentColor,
calc(var(--tw) * 8) 0 currentColor;
will-change: transform;
animation: marquee var(--ad) linear infinite;
animation-play-state: running;
}
@keyframes marquee {
0% { transform: translateX(0); }
100% { transform: translateX(-100%); }
}
/*
* on MacOs: System Preferences >
* Accessibility >
* Display > Reduce motion
*/
@media (prefers-reduced-motion: reduce) {
.marquee span {
animation: none;
text-shadow: none;
width: auto;
display: block;
line-height: 1.5;
text-align: center;
white-space: normal;
}
}
/*Delete this to use a solid color bg*/
.isotropic-cool-bg {
background-color: #F57C00;
background-size:cover;
background-image: url("data:image/svg+xml;utf8, %3Csvg width='1200' height='200' viewBox='0 0 1200.00 200.00' xmlns='http://www.w3.org/2000/svg' xmlns:xlink= 'http://www.w3.org/1999/xlink' %3E %3Crect width='1200.00' height='200.00' fill='%23F57C00' /%3E %3Cg transform='translate(125.00, 25.00)'%3E %3Cg transformOrigin='center' transform='scale(0.50, 0.50)'%3E %3Cg transformOrigin='center' transform='rotate(143.00, 50, 50)'%3E %3Cg opacity='1'%3E %3Cg clip-path='url(%23clip0)'%3E %3Cpath d='M0 4.37114e-06L100 0L50 50L0 4.37114e-06Z' fill='%23E65100'%3E%3C/path%3E %3Cpath d='M0 50L100 50L50 100L0 50Z' fill='%23E65100'%3E%3C/path%3E %3C/g%3E %3Cdefs%3E %3CclipPath id='clip0'%3E %3Crect width='100' height='100' fill='white'%3E%3C/rect%3E %3C/clipPath%3E %3C/defs%3E %3C/g%3E %3C/g%3E %3C/g%3E %3C/g%3E %3Cg transform='translate(223.50, 23.50)'%3E %3Cg transformOrigin='center' transform='scale(0.53, 0.53)'%3E %3Cg transformOrigin='center' transform='rotate(123.00, 50, 50)'%3E %3Cg opacity='1'%3E %3Cpath d='M0 100V0L50 50L0 100Z' fill='%23E65100'%3E%3C/path%3E %3Cpath d='M50 100V0L100 50L50 100Z' fill='%23E65100'%3E%3C/path%3E %3C/g%3E %3C/g%3E %3C/g%3E %3C/g%3E %3Cg transform='translate(428.50, 28.50)'%3E %3Cg transformOrigin='center' transform='scale(0.43, 0.43)'%3E %3Cg transformOrigin='center' transform='rotate(116.00, 50, 50)'%3E %3Cg opacity='1'%3E %3Cpath d='M50 100L100 50V100H50Z' fill='%23E65100'%3E%3C/path%3E %3Cpath d='M0 50L50 0V50H0Z' fill='%23E65100'%3E%3C/path%3E %3Cpath d='M25 75L75 25V75H25Z' fill='%23E65100'%3E%3C/path%3E %3C/g%3E %3C/g%3E %3C/g%3E %3C/g%3E %3Cg transform='translate(524.00, 24.00)'%3E %3Cg transformOrigin='center' transform='scale(0.52, 0.52)'%3E %3Cg transformOrigin='center' transform='rotate(292.00, 50, 50)'%3E %3Cg opacity='1'%3E %3Cpath d='M100 50H50L100 100V50Z' fill='%23E65100'%3E%3C/path%3E %3Cpath d='M100 0H50L100 50V0Z' fill='%23E65100'%3E%3C/path%3E %3Cpath d='M50 50H0L50 100V50Z' fill='%23E65100'%3E%3C/path%3E %3Cpath d='M50 0H0L50 50V0Z' fill='%23E65100'%3E%3C/path%3E %3C/g%3E %3C/g%3E %3C/g%3E %3C/g%3E %3Cg transform='translate(620.50, 20.50)'%3E %3Cg transformOrigin='center' transform='scale(0.59, 0.59)'%3E %3Cg transformOrigin='center' transform='rotate(332.00, 50, 50)'%3E %3Cg opacity='1'%3E %3Cpath d='M100 50H50L100 100V50Z' fill='%23E65100'%3E%3C/path%3E %3Cpath d='M100 0H50L100 50V0Z' fill='%23E65100'%3E%3C/path%3E %3Cpath d='M50 50H0L50 100V50Z' fill='%23E65100'%3E%3C/path%3E %3Cpath d='M50 0H0L50 50V0Z' fill='%23E65100'%3E%3C/path%3E %3C/g%3E %3C/g%3E %3C/g%3E %3C/g%3E %3Cg transform='translate(717.00, 17.00)'%3E %3Cg transformOrigin='center' transform='scale(0.66, 0.66)'%3E %3Cg transformOrigin='center' transform='rotate(128.00, 50, 50)'%3E %3Cg opacity='1'%3E %3Cg clip-path='url(%23clip0)'%3E %3Cpath d='M0 100L100 100L50 50L0 100Z' fill='%23E65100'%3E%3C/path%3E %3Cpath d='M0 4.37114e-06L100 0L50 50L0 4.37114e-06Z' fill='%23E65100'%3E%3C/path%3E %3C/g%3E %3Cdefs%3E %3CclipPath id='clip0'%3E %3Crect width='100' height='100' fill='white'%3E%3C/rect%3E %3C/clipPath%3E %3C/defs%3E %3C/g%3E %3C/g%3E %3C/g%3E %3C/g%3E %3Cg transform='translate(821.50, 21.50)'%3E %3Cg transformOrigin='center' transform='scale(0.57, 0.57)'%3E %3Cg transformOrigin='center' transform='rotate(68.00, 50, 50)'%3E %3Cg opacity='1'%3E %3Cpath d='M0 100V0L50 50L0 100Z' fill='%23E65100'%3E%3C/path%3E %3Cpath d='M50 100V0L100 50L50 100Z' fill='%23E65100'%3E%3C/path%3E %3C/g%3E %3C/g%3E %3C/g%3E %3C/g%3E %3Cg transform='translate(928.50, 28.50)'%3E %3Cg transformOrigin='center' transform='scale(0.43, 0.43)'%3E %3Cg transformOrigin='center' transform='rotate(114.00, 50, 50)'%3E %3Cg opacity='1'%3E %3Cg clip-path='url(%23clip0)'%3E %3Cpath d='M0 4.37114e-06L100 0L50 50L0 4.37114e-06Z' fill='%23E65100'%3E%3C/path%3E %3Cpath d='M0 50L100 50L50 100L0 50Z' fill='%23E65100'%3E%3C/path%3E %3C/g%3E %3Cdefs%3E %3CclipPath id='clip0'%3E %3Crect width='100' height='100' fill='white'%3E%3C/rect%3E %3C/clipPath%3E %3C/defs%3E %3C/g%3E %3C/g%3E %3C/g%3E %3C/g%3E %3Cg transform='translate(1120.50, 20.50)'%3E %3Cg transformOrigin='center' transform='scale(0.59, 0.59)'%3E %3Cg transformOrigin='center' transform='rotate(80.00, 50, 50)'%3E %3Cg opacity='1'%3E %3Cg clip-path='url(%23clip0)'%3E %3Cpath d='M0 4.37114e-06L100 0L50 50L0 4.37114e-06Z' fill='%23E65100'%3E%3C/path%3E %3Cpath d='M0 50L100 50L50 100L0 50Z' fill='%23E65100'%3E%3C/path%3E %3C/g%3E %3Cdefs%3E %3CclipPath id='clip0'%3E %3Crect width='100' height='100' fill='white'%3E%3C/rect%3E %3C/clipPath%3E %3C/defs%3E %3C/g%3E %3C/g%3E %3C/g%3E %3C/g%3E %3Cg transform='translate(19.00, 119.00)'%3E %3Cg transformOrigin='center' transform='scale(0.62, 0.62)'%3E %3Cg transformOrigin='center' transform='rotate(308.00, 50, 50)'%3E %3Cg opacity='1'%3E %3Cpath d='M50 100L0 50V100H50Z' fill='%23E65100'%3E%3C/path%3E %3Cpath d='M100 50L50 0V50H100Z' fill='%23E65100'%3E%3C/path%3E %3Cpath d='M75 75L25 25V75H75Z' fill='%23E65100'%3E%3C/path%3E %3C/g%3E %3C/g%3E %3C/g%3E %3C/g%3E %3Cg transform='translate(120.00, 120.00)'%3E %3Cg transformOrigin='center' transform='scale(0.60, 0.60)'%3E %3Cg transformOrigin='center' transform='rotate(105.00, 50, 50)'%3E %3Cg opacity='1'%3E %3Cpath d='M100 0V100L50 50L100 0Z' fill='%23E65100'%3E%3C/path%3E %3Cpath d='M50 0V100L0 50L50 0Z' fill='%23E65100'%3E%3C/path%3E %3C/g%3E %3C/g%3E %3C/g%3E %3C/g%3E %3Cg transform='translate(220.50, 120.50)'%3E %3Cg transformOrigin='center' transform='scale(0.59, 0.59)'%3E %3Cg transformOrigin='center' transform='rotate(225.00, 50, 50)'%3E %3Cg opacity='1'%3E %3Cpath d='M100 0V100L50 50L100 0Z' fill='%23E65100'%3E%3C/path%3E %3Cpath d='M50 0V100L0 50L50 0Z' fill='%23E65100'%3E%3C/path%3E %3C/g%3E %3C/g%3E %3C/g%3E %3C/g%3E %3Cg transform='translate(317.00, 117.00)'%3E %3Cg transformOrigin='center' transform='scale(0.66, 0.66)'%3E %3Cg transformOrigin='center' transform='rotate(81.00, 50, 50)'%3E %3Cg opacity='1'%3E %3Cg clip-path='url(%23clip0)'%3E %3Cpath d='M100 100L0 100L50 50L100 100Z' fill='%23E65100'%3E%3C/path%3E %3Cpath d='M100 50L0 50L50 -2.18557e-06L100 50Z' fill='%23E65100'%3E%3C/path%3E %3C/g%3E %3Cdefs%3E %3CclipPath id='clip0'%3E %3Crect width='100' height='100' fill='white'%3E%3C/rect%3E %3C/clipPath%3E %3C/defs%3E %3C/g%3E %3C/g%3E %3C/g%3E %3C/g%3E %3Cg transform='translate(518.50, 118.50)'%3E %3Cg transformOrigin='center' transform='scale(0.63, 0.63)'%3E %3Cg transformOrigin='center' transform='rotate(213.00, 50, 50)'%3E %3Cg opacity='1'%3E %3Cpath d='M50 100L0 50V100H50Z' fill='%23E65100'%3E%3C/path%3E %3Cpath d='M100 50L50 0V50H100Z' fill='%23E65100'%3E%3C/path%3E %3Cpath d='M75 75L25 25V75H75Z' fill='%23E65100'%3E%3C/path%3E %3C/g%3E %3C/g%3E %3C/g%3E %3C/g%3E %3Cg transform='translate(623.00, 123.00)'%3E %3Cg transformOrigin='center' transform='scale(0.54, 0.54)'%3E %3Cg transformOrigin='center' transform='rotate(170.00, 50, 50)'%3E %3Cg opacity='1'%3E %3Cpath d='M25 0L50 50H0L25 0Z' fill='%23E65100'%3E%3C/path%3E %3Cpath d='M25 50L50 100H0L25 50Z' fill='%23E65100'%3E%3C/path%3E %3Cpath d='M75 0L100 50H50L75 0Z' fill='%23E65100'%3E%3C/path%3E %3Cpath d='M75 50L100 100H50L75 50Z' fill='%23E65100'%3E%3C/path%3E %3C/g%3E %3C/g%3E %3C/g%3E %3C/g%3E %3Cg transform='translate(716.00, 116.00)'%3E %3Cg transformOrigin='center' transform='scale(0.68, 0.68)'%3E %3Cg transformOrigin='center' transform='rotate(252.00, 50, 50)'%3E %3Cg opacity='1'%3E %3Cpath d='M100 50H50L100 0V50Z' fill='%23E65100'%3E%3C/path%3E %3Cpath d='M100 100H50L100 50V100Z' fill='%23E65100'%3E%3C/path%3E %3Cpath d='M50 50H0L50 0V50Z' fill='%23E65100'%3E%3C/path%3E %3Cpath d='M50 100H0L50 50V100Z' fill='%23E65100'%3E%3C/path%3E %3C/g%3E %3C/g%3E %3C/g%3E %3C/g%3E %3Cg transform='translate(822.00, 122.00)'%3E %3Cg transformOrigin='center' transform='scale(0.56, 0.56)'%3E %3Cg transformOrigin='center' transform='rotate(307.00, 50, 50)'%3E %3Cg opacity='1'%3E %3Cpath d='M0 100V0L50 50L0 100Z' fill='%23E65100'%3E%3C/path%3E %3Cpath d='M50 100V0L100 50L50 100Z' fill='%23E65100'%3E%3C/path%3E %3C/g%3E %3C/g%3E %3C/g%3E %3C/g%3E %3Cg transform='translate(922.50, 122.50)'%3E %3Cg transformOrigin='center' transform='scale(0.55, 0.55)'%3E %3Cg transformOrigin='center' transform='rotate(302.00, 50, 50)'%3E %3Cg opacity='1'%3E %3Cg clip-path='url(%23clip0)'%3E %3Cpath d='M0 4.37114e-06L100 0L50 50L0 4.37114e-06Z' fill='%23E65100'%3E%3C/path%3E %3Cpath d='M0 50L100 50L50 100L0 50Z' fill='%23E65100'%3E%3C/path%3E %3C/g%3E %3Cdefs%3E %3CclipPath id='clip0'%3E %3Crect width='100' height='100' fill='white'%3E%3C/rect%3E %3C/clipPath%3E %3C/defs%3E %3C/g%3E %3C/g%3E %3C/g%3E %3C/g%3E %3Cg transform='translate(1015.50, 115.50)'%3E %3Cg transformOrigin='center' transform='scale(0.69, 0.69)'%3E %3Cg transformOrigin='center' transform='rotate(106.00, 50, 50)'%3E %3Cg opacity='1'%3E %3Cpath d='M100 50H50L100 100V50Z' fill='%23E65100'%3E%3C/path%3E %3Cpath d='M100 0H50L100 50V0Z' fill='%23E65100'%3E%3C/path%3E %3Cpath d='M50 50H0L50 100V50Z' fill='%23E65100'%3E%3C/path%3E %3Cpath d='M50 0H0L50 50V0Z' fill='%23E65100'%3E%3C/path%3E %3C/g%3E %3C/g%3E %3C/g%3E %3C/g%3E %3Cg transform='translate(1126.00, 126.00)'%3E %3Cg transformOrigin='center' transform='scale(0.48, 0.48)'%3E %3Cg transformOrigin='center' transform='rotate(88.00, 50, 50)'%3E %3Cg opacity='1'%3E %3Cpath d='M0 100V0L50 50L0 100Z' fill='%23E65100'%3E%3C/path%3E %3Cpath d='M50 100V0L100 50L50 100Z' fill='%23E65100'%3E%3C/path%3E %3C/g%3E %3C/g%3E %3C/g%3E %3C/g%3E %3C/svg%3E ");
}
Also see: Tab Triggers