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.
<svg width="800" height="600" viewBox="0 0 800 600" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="800" height="600" fill="#111111"/>
<rect x="99.5" width="1" height="600" fill="8E78FF" fill-opacity="0.1"/>
<rect x="199.5" width="1" height="600" fill="8E78FF" fill-opacity="0.1"/>
<rect x="299.5" width="1" height="600" fill="8E78FF" fill-opacity="0.1"/>
<rect x="399.5" width="1" height="600" fill="8E78FF" fill-opacity="0.1"/>
<rect x="499.5" width="1" height="600" fill="8E78FF" fill-opacity="0.1"/>
<rect x="599.5" width="1" height="600" fill="8E78FF" fill-opacity="0.1"/>
<rect x="699.5" width="1" height="600" fill="8E78FF" fill-opacity="0.1"/>
<rect y="500.5" width="1" height="799" transform="rotate(-90 0 500.5)" fill="black" fill-opacity="0.1"/>
<rect y="400.5" width="1" height="799" transform="rotate(-90 0 400.5)" fill="8E78FF" fill-opacity="0.1"/>
<rect y="300.5" width="1" height="799" transform="rotate(-90 0 300.5)" fill="8E78FF" fill-opacity="0.1"/>
<rect y="200.5" width="1" height="799" transform="rotate(-90 0 200.5)" fill="8E78FF" fill-opacity="0.1"/>
<rect y="100.5" width="1" height="799" transform="rotate(-90 0 100.5)" fill="8E78FF" fill-opacity="0.1"/>
<g filter="url(#filter0_d)">
<path d="M89 116.343V100C89 97.7908 90.7908 96 93 96H109.343C112.907 96 114.691 100.309 112.171 102.828L95.8284 119.171C93.3085 121.691 89 119.907 89 116.343Z" fill="8E78FF" fill-opacity="0.9"/>
</g>
<g filter="url(#filter1_d)">
<path d="M89 103.343V87C89 84.7908 90.7908 83 93 83H109.343C112.907 83 114.691 87.3085 112.171 89.8284L95.8284 106.171C93.3085 108.691 89 106.907 89 103.343Z" fill="8E78FF" fill-opacity="0.9"/>
</g>
<path d="M200 100H600" class="stroke-animation" stroke="#8E78FF" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" stroke-dasharray="2 8"/>
<circle cx="200" cy="100" r="2" transform="rotate(-180 200 100)" fill="#8E78FF" stroke="#8E78FF" stroke-width="2"/>
<path d="M100 500V500C100 444.772 144.772 400 200 400V400" stroke="#8E78FF" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<circle cx="100" cy="500" r="2" transform="rotate(90 100 500)" fill="#8E78FF" stroke="#8E78FF" stroke-width="2"/>
<path d="M195 400L200 395L205 400L200 405L195 400Z" fill="#8E78FF" stroke="#8E78FF" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M600 300V300C600 244.772 555.228 200 500 200V200" stroke="#8E78FF" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<circle r="2" transform="matrix(0 1 1 0 600 300)" fill="#8E78FF" stroke="#8E78FF" stroke-width="2"/>
<path d="M505 206L499 200L505 194" stroke="#8E78FF" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M400 300V300C400 244.772 355.228 200 300 200H100" stroke="#8E78FF" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<circle r="2" transform="matrix(0 1 1 0 400 300)" fill="#8E78FF" stroke="#8E78FF" stroke-width="2"/>
<path d="M105 206L99 200L105 194" stroke="#8E78FF" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M200 400V400C200 455.228 244.772 500 300 500V500" stroke="#8E78FF" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<circle r="2" transform="matrix(0 -1 -1 0 200 400)" fill="#8E78FF" stroke="#8E78FF" stroke-width="2"/>
<circle r="2" transform="matrix(1 0 0 -1 300 500)" fill="#8E78FF" stroke="#8E78FF" stroke-width="2"/>
<path d="M300 500H580C646.274 500 700 446.274 700 380V300" stroke="#8E78FF" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="stroke-animation" stroke-dasharray="2 8"/>
<circle r="2" transform="matrix(-1 0 0 1 300 500)" fill="#8E78FF" stroke="#8E78FF" stroke-width="2"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M676 300C676 286.745 686.745 276 700 276C713.255 276 724 286.745 724 300C724 313.255 713.255 324 700 324C686.745 324 676 313.255 676 300Z" stroke="#8E78FF" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<circle r="2" transform="matrix(0 -1 -1 0 700 300)" fill="#8E78FF" stroke="#8E78FF" stroke-width="2"/>
<path d="M400 300V300C400 355.228 444.772 400 500 400L600 400" stroke="#8E78FF" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<circle r="3" transform="matrix(4.37114e-08 -1 -1 -4.37114e-08 400 300)" fill="#7559FF" stroke="#8E78FF" stroke-width="2"/>
<path d="M595 394L601 400L595 406" stroke="#8E78FF" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M100 300H200C255.228 300 300 344.772 300 400V400" stroke="#8E78FF" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="stroke-animation" stroke-dasharray="2 8"/>
<path d="M100 297C98.3431 297 97 298.343 97 300C97 301.657 98.3431 303 100 303C101.657 303 103 301.657 103 300C103 298.343 101.657 297 100 297Z" fill="#7559FF" stroke="#8E78FF" stroke-width="2"/>
<path d="M294 395L300 401L306 395" stroke="#8E78FF" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M600 100V100C655.228 100 700 144.772 700 200V200" stroke="#8E78FF" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<circle cx="600" cy="100" r="2" transform="rotate(-180 600 100)" fill="#8E78FF" stroke="#8E78FF" stroke-width="2"/>
<path d="M694 195L700 201L706 195" stroke="#8E78FF" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<defs>
<filter id="filter0_d" x="85.0791" y="96" width="32.1927" height="32.1927" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dy="3.92089"/>
<feGaussianBlur stdDeviation="1.96044"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0"/>
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow"/>
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow" result="shape"/>
</filter>
<filter id="filter1_d" x="85.0791" y="83" width="32.1927" height="32.1927" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dy="3.92089"/>
<feGaussianBlur stdDeviation="1.96044"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0"/>
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow"/>
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow" result="shape"/>
</filter>
</defs>
</svg>
body
background: #111
margin: 4rem
.flow-svg
// background: red
width: fit-content
height: 360px
svg
height: 50%
.stroke-animation
stroke-dasharray: 6, 12
stroke-dashoffset: 0
transition: stroke-dasharray .25s
animation: strokeDance 180s infinite linear
@keyframes strokeDance
0%, 100%
stroke-dashoffset: 0
50%
stroke-dashoffset: -6000
@keyframes startBounce
0%, 100%
Also see: Tab Triggers