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 class="a" version="1.0" xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 3601 3601">
<path d="M1963 419c-84 6-159 21-234 49a778 778 0 00-340 244 674 674 0 00-138 314c-10 51-14 89-25 231l-7 103c-11 115-23 195-44 277a1372 1372 0 01-397 678c-74 65-159 125-233 163-150 78-285 85-373 20a224 224 0 01-46-47c-11-12-30-12-42 0-8 7-10 16-8 25 3 11 21 35 40 55l7 8-4 2c-11 8-17 24-14 40 5 26 21 58 44 87a1667 1667 0 00625 413c268 100 562 127 852 78 281-48 548-173 860-404a1449 1449 0 00439-479c1 3 9 10 13 11 10 3 51-1 86-7 55-10 124-33 188-63a633 633 0 00200-150 486 486 0 00113-331 395 395 0 00-47-158c-8-8-22-12-33-10-12 2-15 4-36 25a476 476 0 01-210 147c-40 10-80 6-115-9l-5-3v-47a1341 1341 0 00-102-514c-61-147-136-275-226-382a1013 1013 0 00-358-280 918 918 0 00-431-86zm83 87c74 4 142 17 215 42a977 977 0 01443 317c77 97 144 212 192 333 72 180 105 372 92 547-15 211-84 412-201 587-91 137-203 245-387 377-121 87-232 158-322 206a1529 1529 0 01-901 172 1560 1560 0 01-886-398c-55-45-80-72-95-98l-3-6 4 2a330 330 0 00136 26c29 0 36-1 51-3 148-20 319-110 478-253l83-83c85-94 150-191 208-307 80-160 129-325 154-519 8-58 13-115 17-200 4-83 8-126 14-171 12-94 35-167 71-232 37-65 86-124 146-174a714 714 0 01491-165zm1393 1180a387 387 0 01-94 356 585 585 0 01-241 157c-24 8-44 13-96 27a4173 4173 0 00-67 17l13-27a1235 1235 0 00120-421v-5l8 4c11 5 29 11 43 14 17 3 48 4 67 2 71-10 145-49 228-122l16-13 3 11z" />
<path d="M2296 1172c-53 7-94 40-122 96-26 52-35 115-23 172 13 64 47 116 91 138 18 9 34 13 56 13 23 0 40-4 60-14 53-27 92-92 103-173 2-14 2-48 0-62-12-79-52-141-103-162-15-6-25-8-43-9l-19 1zm20 61c18 3 35 13 49 28 15 15 26 35 34 60 10 28 14 62 11 82v5l-3-11c-14-54-55-82-93-62-28 15-48 55-48 100 0 23 4 42 13 61 6 13 12 21 21 29l7 7h-6c-42-5-75-38-92-91-9-24-13-54-12-75 3-45 18-85 42-109 9-9 14-14 24-18 16-9 32-10 53-6zM2682 1179c-42 6-77 34-100 79-19 36-29 84-26 123 4 51 23 94 52 124 16 16 31 25 51 31 9 2 11 2 28 2s19 0 29-2c38-11 69-40 90-85 22-46 29-98 18-144-12-58-43-103-82-121-17-8-41-11-60-8zm16 58c27 5 49 24 63 54l4 9-7-5a56 56 0 00-39-14c-14 2-25 7-38 20-40 41-42 129-2 173l5 5c-2 0-16-5-21-8-30-17-52-58-56-107-3-33 6-70 23-95 17-26 40-36 68-32zM2693 1750c-7 1-9 3-35 17-160 87-291 131-418 140h-80c-99-7-195-39-282-94-16-10-19-11-26-11-15 0-30 14-31 31-1 12 2 18 19 33 79 70 180 111 306 124 21 2 83 3 107 1 123-8 250-45 391-113 25-13 27-14 28-12 2 12 3 47 1 65-6 66-35 132-83 198a651 651 0 01-541 253c-57-4-114-16-178-37-26-9-28-9-35-8-11 2-20 8-26 18-6 9-8 18-8 28 1 16 8 24 28 33a662 662 0 00345 46 732 732 0 00511-310c20-29 43-72 55-101a350 350 0 0010-257c-7-17-11-23-19-31a43 43 0 00-39-13z" />
</svg>
<br />
<svg class="b" version="1.0" xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 3601 3600">
<path d="M1877 77a597 597 0 00-315 120 976 976 0 00-204 200c-108 145-181 328-232 582-19 94-32 173-59 374-24 173-34 239-50 321-45 249-108 425-202 565a846 846 0 01-370 312c-21 10-27 15-28 29-1 15 9 27 24 27a899 899 0 00276-147c44-36 92-84 128-130 98-124 169-284 218-496 24-102 42-203 68-383l17-119c31-216 55-340 87-459a1226 1226 0 01225-465 607 607 0 01530-242 564 564 0 01495 383c51 163 56 332 16 562-12 65-24 126-55 262-34 146-47 209-59 281-18 107-25 188-24 273 2 107 4 156 9 214 15 163 52 318 109 453a856 856 0 00391 453 649 649 0 0094 41 594 594 0 00-247 143c-32 27-68 61-115 107-47 45-72 65-100 79-25 13-36 16-63 15-17-1-24-2-38-8-21-8-43-27-59-51-21-32-33-60-62-145-25-75-34-99-49-130-17-37-35-62-56-84-27-27-54-41-93-50l-21-5c-22-6-57-9-81-6-69 7-139 41-230 110l-110 86c-65 53-107 80-141 91-13 4-21 5-33 5-17 0-31-4-45-14-5-4-6-6-10-13-21-43-27-96-20-176 5-70 5-76 5-105 0-43-2-64-13-100-7-23-11-34-19-50-52-105-170-146-334-116a750 750 0 00-192 67c-67 34-98 48-132 61-40 14-71 21-101 21-41 0-73-14-102-44-30-31-54-79-74-150l-6-18-5-4c-9-9-17-11-23-7-7 5-10 12-12 27-5 32 8 94 28 142 24 55 56 95 93 116 7 4 39 16 51 20 31 9 67 10 104 3 40-8 69-19 147-57 63-31 65-32 121-55 88-36 177-52 241-41 57 9 97 36 118 82 15 33 21 71 18 124l-6 131c-1 86 10 142 39 186 9 13 27 31 41 40 10 7 26 16 35 18 15 5 53 7 75 4 48-7 96-29 152-69 20-15 47-38 90-74l55-47c75-61 129-90 186-97 13-2 40-2 54 1 22 3 48 11 67 21 23 11 46 39 64 75 11 24 17 43 35 102l19 61c32 95 69 151 123 186 12 9 24 14 38 19 24 7 41 10 66 10 49 0 94-15 147-50 37-25 71-52 138-115 70-65 96-88 130-113 63-47 116-71 175-80 16-3 52-3 69-1 16 2 38 7 52 11 12 4 15 4 23 4 9 1 10 0 16-3 15-7 24-20 27-38 3-19-6-37-21-47-10-6-38-13-65-17l-12-2v-11c0-10-1-11-4-17-6-14-16-20-32-22l-21-2c-70-7-144-37-212-86a908 908 0 01-260-328c-65-130-105-270-123-431a2256 2256 0 015-468c15-134 36-255 83-484 26-124 39-200 47-275 15-129 11-240-12-338a692 692 0 00-187-341 687 687 0 00-525-194z" />
<path d="M1716 533c-24 5-45 16-65 36-27 26-47 58-61 99-26 75-22 153 9 201 7 11 21 25 31 32 9 6 23 13 34 16 6 2 9 2 18 2 47-3 91-38 121-98a327 327 0 0030-182c-10-57-40-94-84-106-11-2-23-3-33 0zm22 47a75 75 0 0128 19l-7-2c-8-2-22-2-30 0-44 12-82 73-94 150-3 19-3 50-1 65 3 13 8 30 13 37l3 6-3-2c-5-4-13-15-18-24-13-25-20-66-16-105 3-30 9-54 20-75 18-38 45-64 73-71 8-2 23-1 32 2zM2102 604c-72 9-132 89-148 196-3 14-4 50-2 65 7 64 36 107 85 123 27 10 64-1 93-26 38-35 67-93 79-158 4-25 5-60 3-82-7-63-38-105-86-116-12-3-16-3-24-2zm15 49c7 3 17 10 23 14 2 2 2 3 1 3-20-6-40-2-58 11-9 7-25 23-32 34a267 267 0 00-39 166c3 18 8 33 14 43 3 5 3 5 0 3-5-3-15-16-20-28-12-23-17-50-16-87 1-36 7-64 20-89 15-31 36-55 58-66 12-6 18-7 30-7 10 1 13 1 18 3zM1555 1182c-18 6-22 32-6 42l13 14c51 68 125 117 218 143a511 511 0 00219 17l16-2-23 39a780 780 0 01-114 137c-17 11-41 20-63 25-9 2-14 2-29 2-17 0-20 0-28-2-29-7-46-22-58-46-5-11-8-22-9-36l-3-27c-5-43-6-75-3-94 2-12 3-27 2-33l-4-8c-9-9-22-8-28 3-3 6-3 11 0 14l2 3-2 7c-4 10-6 21-9 33a416 416 0 0014 151c21 63 84 95 163 83 44-6 88-27 117-55l16-17a3408 3408 0 0157-66c50-61 70-103 59-128l-2-5 5-4c6-7 8-13 8-22 0-7 0-10-2-14-3-6-9-12-14-14-9-4-30-2-72 7-47 10-61 12-95 11a444 444 0 01-273-99l-15-11c-6-3-11-9-19-21-10-14-17-22-22-25s-12-3-16-2z" />
<path d="M1802 1408c-5 2-13 13-22 31-12 23-17 43-16 61 1 13 3 18 10 21 7 4 17 0 22-8 3-4 3-5 3-19 1-17 3-28 6-39 3-8 9-19 13-24l5-7c3-5 0-13-7-16-6-2-8-2-14 0z" />
</svg>
<svg class="b" version="1.0" xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 3601 3600">
<path d="M1877 77a597 597 0 00-315 120 976 976 0 00-204 200c-108 145-181 328-232 582-19 94-32 173-59 374-24 173-34 239-50 321-45 249-108 425-202 565a846 846 0 01-370 312c-21 10-27 15-28 29-1 15 9 27 24 27a899 899 0 00276-147c44-36 92-84 128-130 98-124 169-284 218-496 24-102 42-203 68-383l17-119c31-216 55-340 87-459a1226 1226 0 01225-465 607 607 0 01530-242 564 564 0 01495 383c51 163 56 332 16 562-12 65-24 126-55 262-34 146-47 209-59 281-18 107-25 188-24 273 2 107 4 156 9 214 15 163 52 318 109 453a856 856 0 00391 453 649 649 0 0094 41 594 594 0 00-247 143c-32 27-68 61-115 107-47 45-72 65-100 79-25 13-36 16-63 15-17-1-24-2-38-8-21-8-43-27-59-51-21-32-33-60-62-145-25-75-34-99-49-130-17-37-35-62-56-84-27-27-54-41-93-50l-21-5c-22-6-57-9-81-6-69 7-139 41-230 110l-110 86c-65 53-107 80-141 91-13 4-21 5-33 5-17 0-31-4-45-14-5-4-6-6-10-13-21-43-27-96-20-176 5-70 5-76 5-105 0-43-2-64-13-100-7-23-11-34-19-50-52-105-170-146-334-116a750 750 0 00-192 67c-67 34-98 48-132 61-40 14-71 21-101 21-41 0-73-14-102-44-30-31-54-79-74-150l-6-18-5-4c-9-9-17-11-23-7-7 5-10 12-12 27-5 32 8 94 28 142 24 55 56 95 93 116 7 4 39 16 51 20 31 9 67 10 104 3 40-8 69-19 147-57 63-31 65-32 121-55 88-36 177-52 241-41 57 9 97 36 118 82 15 33 21 71 18 124l-6 131c-1 86 10 142 39 186 9 13 27 31 41 40 10 7 26 16 35 18 15 5 53 7 75 4 48-7 96-29 152-69 20-15 47-38 90-74l55-47c75-61 129-90 186-97 13-2 40-2 54 1 22 3 48 11 67 21 23 11 46 39 64 75 11 24 17 43 35 102l19 61c32 95 69 151 123 186 12 9 24 14 38 19 24 7 41 10 66 10 49 0 94-15 147-50 37-25 71-52 138-115 70-65 96-88 130-113 63-47 116-71 175-80 16-3 52-3 69-1 16 2 38 7 52 11 12 4 15 4 23 4 9 1 10 0 16-3 15-7 24-20 27-38 3-19-6-37-21-47-10-6-38-13-65-17l-12-2v-11c0-10-1-11-4-17-6-14-16-20-32-22l-21-2c-70-7-144-37-212-86a908 908 0 01-260-328c-65-130-105-270-123-431a2256 2256 0 015-468c15-134 36-255 83-484 26-124 39-200 47-275 15-129 11-240-12-338a692 692 0 00-187-341 687 687 0 00-525-194z" />
<path d="M1716 533c-24 5-45 16-65 36-27 26-47 58-61 99-26 75-22 153 9 201 7 11 21 25 31 32 9 6 23 13 34 16 6 2 9 2 18 2 47-3 91-38 121-98a327 327 0 0030-182c-10-57-40-94-84-106-11-2-23-3-33 0zm22 47a75 75 0 0128 19l-7-2c-8-2-22-2-30 0-44 12-82 73-94 150-3 19-3 50-1 65 3 13 8 30 13 37l3 6-3-2c-5-4-13-15-18-24-13-25-20-66-16-105 3-30 9-54 20-75 18-38 45-64 73-71 8-2 23-1 32 2zM2102 604c-72 9-132 89-148 196-3 14-4 50-2 65 7 64 36 107 85 123 27 10 64-1 93-26 38-35 67-93 79-158 4-25 5-60 3-82-7-63-38-105-86-116-12-3-16-3-24-2zm15 49c7 3 17 10 23 14 2 2 2 3 1 3-20-6-40-2-58 11-9 7-25 23-32 34a267 267 0 00-39 166c3 18 8 33 14 43 3 5 3 5 0 3-5-3-15-16-20-28-12-23-17-50-16-87 1-36 7-64 20-89 15-31 36-55 58-66 12-6 18-7 30-7 10 1 13 1 18 3zM1555 1182c-18 6-22 32-6 42l13 14c51 68 125 117 218 143a511 511 0 00219 17l16-2-23 39a780 780 0 01-114 137c-17 11-41 20-63 25-9 2-14 2-29 2-17 0-20 0-28-2-29-7-46-22-58-46-5-11-8-22-9-36l-3-27c-5-43-6-75-3-94 2-12 3-27 2-33l-4-8c-9-9-22-8-28 3-3 6-3 11 0 14l2 3-2 7c-4 10-6 21-9 33a416 416 0 0014 151c21 63 84 95 163 83 44-6 88-27 117-55l16-17a3408 3408 0 0157-66c50-61 70-103 59-128l-2-5 5-4c6-7 8-13 8-22 0-7 0-10-2-14-3-6-9-12-14-14-9-4-30-2-72 7-47 10-61 12-95 11a444 444 0 01-273-99l-15-11c-6-3-11-9-19-21-10-14-17-22-22-25s-12-3-16-2z" />
<path d="M1802 1408c-5 2-13 13-22 31-12 23-17 43-16 61 1 13 3 18 10 21 7 4 17 0 22-8 3-4 3-5 3-19 1-17 3-28 6-39 3-8 9-19 13-24l5-7c3-5 0-13-7-16-6-2-8-2-14 0z" />
</svg>
<svg class="b" version="1.0" xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 3601 3600">
<path d="M1877 77a597 597 0 00-315 120 976 976 0 00-204 200c-108 145-181 328-232 582-19 94-32 173-59 374-24 173-34 239-50 321-45 249-108 425-202 565a846 846 0 01-370 312c-21 10-27 15-28 29-1 15 9 27 24 27a899 899 0 00276-147c44-36 92-84 128-130 98-124 169-284 218-496 24-102 42-203 68-383l17-119c31-216 55-340 87-459a1226 1226 0 01225-465 607 607 0 01530-242 564 564 0 01495 383c51 163 56 332 16 562-12 65-24 126-55 262-34 146-47 209-59 281-18 107-25 188-24 273 2 107 4 156 9 214 15 163 52 318 109 453a856 856 0 00391 453 649 649 0 0094 41 594 594 0 00-247 143c-32 27-68 61-115 107-47 45-72 65-100 79-25 13-36 16-63 15-17-1-24-2-38-8-21-8-43-27-59-51-21-32-33-60-62-145-25-75-34-99-49-130-17-37-35-62-56-84-27-27-54-41-93-50l-21-5c-22-6-57-9-81-6-69 7-139 41-230 110l-110 86c-65 53-107 80-141 91-13 4-21 5-33 5-17 0-31-4-45-14-5-4-6-6-10-13-21-43-27-96-20-176 5-70 5-76 5-105 0-43-2-64-13-100-7-23-11-34-19-50-52-105-170-146-334-116a750 750 0 00-192 67c-67 34-98 48-132 61-40 14-71 21-101 21-41 0-73-14-102-44-30-31-54-79-74-150l-6-18-5-4c-9-9-17-11-23-7-7 5-10 12-12 27-5 32 8 94 28 142 24 55 56 95 93 116 7 4 39 16 51 20 31 9 67 10 104 3 40-8 69-19 147-57 63-31 65-32 121-55 88-36 177-52 241-41 57 9 97 36 118 82 15 33 21 71 18 124l-6 131c-1 86 10 142 39 186 9 13 27 31 41 40 10 7 26 16 35 18 15 5 53 7 75 4 48-7 96-29 152-69 20-15 47-38 90-74l55-47c75-61 129-90 186-97 13-2 40-2 54 1 22 3 48 11 67 21 23 11 46 39 64 75 11 24 17 43 35 102l19 61c32 95 69 151 123 186 12 9 24 14 38 19 24 7 41 10 66 10 49 0 94-15 147-50 37-25 71-52 138-115 70-65 96-88 130-113 63-47 116-71 175-80 16-3 52-3 69-1 16 2 38 7 52 11 12 4 15 4 23 4 9 1 10 0 16-3 15-7 24-20 27-38 3-19-6-37-21-47-10-6-38-13-65-17l-12-2v-11c0-10-1-11-4-17-6-14-16-20-32-22l-21-2c-70-7-144-37-212-86a908 908 0 01-260-328c-65-130-105-270-123-431a2256 2256 0 015-468c15-134 36-255 83-484 26-124 39-200 47-275 15-129 11-240-12-338a692 692 0 00-187-341 687 687 0 00-525-194z" />
<path d="M1716 533c-24 5-45 16-65 36-27 26-47 58-61 99-26 75-22 153 9 201 7 11 21 25 31 32 9 6 23 13 34 16 6 2 9 2 18 2 47-3 91-38 121-98a327 327 0 0030-182c-10-57-40-94-84-106-11-2-23-3-33 0zm22 47a75 75 0 0128 19l-7-2c-8-2-22-2-30 0-44 12-82 73-94 150-3 19-3 50-1 65 3 13 8 30 13 37l3 6-3-2c-5-4-13-15-18-24-13-25-20-66-16-105 3-30 9-54 20-75 18-38 45-64 73-71 8-2 23-1 32 2zM2102 604c-72 9-132 89-148 196-3 14-4 50-2 65 7 64 36 107 85 123 27 10 64-1 93-26 38-35 67-93 79-158 4-25 5-60 3-82-7-63-38-105-86-116-12-3-16-3-24-2zm15 49c7 3 17 10 23 14 2 2 2 3 1 3-20-6-40-2-58 11-9 7-25 23-32 34a267 267 0 00-39 166c3 18 8 33 14 43 3 5 3 5 0 3-5-3-15-16-20-28-12-23-17-50-16-87 1-36 7-64 20-89 15-31 36-55 58-66 12-6 18-7 30-7 10 1 13 1 18 3zM1555 1182c-18 6-22 32-6 42l13 14c51 68 125 117 218 143a511 511 0 00219 17l16-2-23 39a780 780 0 01-114 137c-17 11-41 20-63 25-9 2-14 2-29 2-17 0-20 0-28-2-29-7-46-22-58-46-5-11-8-22-9-36l-3-27c-5-43-6-75-3-94 2-12 3-27 2-33l-4-8c-9-9-22-8-28 3-3 6-3 11 0 14l2 3-2 7c-4 10-6 21-9 33a416 416 0 0014 151c21 63 84 95 163 83 44-6 88-27 117-55l16-17a3408 3408 0 0157-66c50-61 70-103 59-128l-2-5 5-4c6-7 8-13 8-22 0-7 0-10-2-14-3-6-9-12-14-14-9-4-30-2-72 7-47 10-61 12-95 11a444 444 0 01-273-99l-15-11c-6-3-11-9-19-21-10-14-17-22-22-25s-12-3-16-2z" />
<path d="M1802 1408c-5 2-13 13-22 31-12 23-17 43-16 61 1 13 3 18 10 21 7 4 17 0 22-8 3-4 3-5 3-19 1-17 3-28 6-39 3-8 9-19 13-24l5-7c3-5 0-13-7-16-6-2-8-2-14 0z" />
</svg>
TweenMax.staggerTo(".a", 2, { x: 600 }, 0.5);
TweenMax.staggerTo(".b", 2, { rotation: 90 }, 0.5);
TweenMax.staggerTo(
".a", // grabbing the divs
1, // unsure
{
backgroundColor: "#A901DB",
opacity: 0.5,
ease: Power3.easeOut
},
0.5 // stagger time
);
Also see: Tab Triggers