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 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 800 800">
<path id="hippo" fill="#f36" class="st1" d="M148.802,244.876c2.737-36.735,16.107-69.079,40.099-97.061
c27.038-31.596,60.924-47.386,101.629-47.386c15.481,0,38.483,2.447,69.024,7.287c30.541,4.886,53.533,7.278,69.033,7.278
c23.693,0,57.868,8.847,102.526,26.477c7.914,3.009,17.471,11.239,28.701,24.59c6.381,7.886,16.256,19.769,29.616,35.568
c3.036,2.139,6.998,5.316,11.865,9.595c4.859,4.223,8.194,6.063,9.997,5.456c0.616-1.84,2.149-4.4,4.578-7.735
c1.214-1.225,1.962-1.832,2.261-1.832c0.935,0.607,1.831,1.215,2.747,1.832c0.906,0.616,1.205,2.419,0.906,5.456
c-0.616,5.474-0.906,7.138-0.906,4.998c-0.327,3.056-0.757,5.008-1.373,5.952c-3.952,6.671-5.485,11.847-4.55,15.472
c0.916,3.325,3.765,8.669,8.642,15.958c4.868,7.287,7.586,12.761,8.193,16.405c-0.299,2.728-0.43,7.119-0.43,13.211l-4.568,11.379
c0,8.512,9.865,23.114,29.616,43.78c9.436,4.223,14.117,18.826,14.117,43.714c0,19.47-16.089,29.167-48.273,29.167
c-4.26,0-8.81-0.13-13.678-0.467c-3.335-1.196-8.203-2.56-14.575-4.074c-7.586-0.934-12.761-3.494-15.48-7.773
c-4.877-6.95-12.781-13.509-23.711-19.581c-1.823-0.878-4.485-4.223-7.979-10.016c-3.503-5.774-6.615-9.418-9.333-10.949
c-2.719-1.495-6.68-1.813-11.856-0.878c-8.81,1.494-13.677,2.261-14.574,2.261c-2.139,0-5.25-0.598-9.343-1.831
c-4.11-1.215-7.054-1.831-8.893-1.831c-2.112,9.735-2.589,19.152-1.364,28.252c0.298,2.448,1.831,4.428,4.559,5.923
c4.27,3.046,6.531,4.709,6.849,5.045c2.718,2.111,5.615,5.605,8.642,10.445c0.616,1.849-0.523,4.952-3.419,9.342
c-2.887,4.41-5.223,7.008-7.063,7.736c-1.813,0.785-5.765,1.178-11.847,1.178c-8.82,0-12.295,0.131-10.464,0.43
c-12.145-1.831-18.984-2.878-20.516-3.158c-7.587-1.532-14.126-3.943-19.582-7.305c-2.756-1.813-5.913-10.333-9.557-25.524
c-3.681-16.406-6.717-26.272-9.137-29.635c-0.598-0.896-1.355-1.326-2.261-1.326c-1.533,0-4.045,1.494-7.53,4.559
c-3.494,2.99-5.858,4.652-7.054,5.008c-4.242,17.9-6.4,26.402-6.4,25.468c0,7.007,1.972,12.892,5.924,17.77
c3.943,4.858,8.063,9.567,12.323,14.107c5.157,5.774,7.736,10.782,7.736,15.042c0,2.41-0.748,4.521-2.28,6.372
c-6.381,7.885-17.022,11.847-31.905,11.847c-16.713,0-27.644-2.28-32.792-6.839c-6.699-5.774-10.949-11.865-12.762-18.199
c-0.298-1.533-1.055-6.091-2.28-13.678c-0.607-4.578-1.98-7.287-4.082-8.184c-6.101-0.916-13.687-2.578-22.778-5.007
c-1.841-1.215-3.811-4.26-5.942-9.118c-3.933-9.399-6.83-15.789-8.661-19.134c-9.128-4.56-23.702-9.698-43.761-15.453
c-0.916,1.831-1.345,4.373-1.345,7.718c3.335,4.26,8.343,10.8,15.032,19.581c5.466,7.288,8.203,14.295,8.203,20.965
c0,12.781-8.203,19.134-24.609,19.134c-12.453,0-20.955-0.878-25.523-2.709c-6.671-2.728-12.295-9.136-16.854-19.134
c-7.596-16.742-11.847-26.159-12.762-28.27c-4.868-11.231-8.204-21.133-10.006-29.653c-1.233-6.055-3.064-15.35-5.485-27.804
c-2.121-10.296-5.456-18.358-10.015-24.132C155.332,279.36,147.578,260.665,148.802,244.876z" />
<path id="elephant" fill="#09f" class="st1" d="M446.47,99.669c12.095,0,23.828,7.003,35.234,20.993c11.378,13.989,17.971,20.993,19.755,20.993
h17.116c36.996,0,65.654,18.517,85.956,55.547c5.35,10.365,13.524,25.586,24.584,45.697c11.01,20.144,23.856,35.008,38.464,44.628
c16.366,10.694,32.917,16.59,49.644,17.631c7.819,0.361,16.394-1.073,25.657-4.298c8.186-3.58,16.36-7.172,24.54-10.754
l5.344,11.859c-26.337,20.215-51.436,30.64-75.297,31.363c-25.619,0.712-53.231-5.514-82.764-18.643
c25.263,29.205,47,47.005,65.161,53.385l-4.271,4.304c-32.041-5.7-61.607-22.099-88.655-49.147l-21.365,12.769
c0,1.434-1.33,2.94-4.002,4.534c-2.672,1.599-3.85,2.908-3.493,3.981c1.434,4.627,8.743,15.998,21.906,34.062
c13.174,18.129,19.755,27.711,19.755,28.751c0,3.197-4.101,6.384-12.286,9.586c-8.18,3.193-12.621,6.746-13.333,10.655
c-0.722,3.198,0.329,7.107,3.198,11.707c2.83,4.627,4.264,7.43,4.264,8.53c0,7.08-6.23,11.509-18.67,13.305
c-2.163,0.329-8.936,0.526-20.313,0.526c-21.348,0-36.668-4.796-45.927-14.345c-7.468-8.146-13.365-23.046-17.636-44.656
c-1.434-7.43-3.909-20.729-7.468-39.898c-36.307,9.253-73.698,13.886-112.166,13.886c-23.505,0-48.96-1.764-76.38-5.344
c4.637,11.76,11.223,31.357,19.798,58.766c-17.806-2.502-39.186-6.055-64.093-10.688c-11.055,16.721-20.506,24.742-28.329,24.026
c-13.886-1.046-33.837-7.989-59.818-20.795c-6.416-3.198-9.614-8.021-9.614-14.438c0-6.395,4.993-18.161,14.959-35.245
c9.949-17.077,15.293-29.008,16.009-35.786c0.718-6.072-1.035-14.405-5.311-25.103c-5.344-13.891-8.378-22.941-9.09-27.245h2.146
l-4.276-12.818c-16.393,17.8-31.351,30.804-44.88,38.989c-15.682,9.61-34.199,15.868-55.548,18.671
c-4.27-4.238-7.106-6.379-8.541-6.379c26.341-11.41,52.355-29.375,77.973-53.959c1.079-1.073,7.825-5.858,20.314-14.438
c7.101-4.621,11.371-10.101,12.811-16.518c8.887-35.595,27.048-60.732,54.463-75.335c22.427-11.739,53.953-17.603,94.53-17.603
c18.518,0,36.154,1.238,52.876,3.717c7.829,2.146,20.307,4.66,37.391,7.491c1.434-14.17,6.422-26.752,14.963-37.741
C421.377,106.059,432.947,99.669,446.47,99.669z" />
<path stroke="#000" id="cock" d="m152.186499,224.542767c-6.884021,-2.839361 -14.377249,1.310964 -21.731829,-2.824613c5.947935,-0.356416 14.885519,-0.026851 13.307171,-8.523394c2.602501,-9.922057 -2.679016,-20.331368 1.717956,-28.966578c-6.886221,-6.328648 -14.114109,-13.82144 -17.785534,-22.660958c-0.736842,3.566137 -1.415942,6.402996 -2.463159,0.25481c-0.600307,-3.008734 -0.236028,7.437339 -2.531227,0.107781c-2.420829,-6.517464 -8.938271,-23.511488 -10.960479,-7.749361c-0.839876,8.13371 -3.475503,2.362572 -4.680157,-2.799054c-1.223967,-9.939254 -5.644962,-19.147021 -6.802881,-29.066869c4.525621,-6.283915 -0.645156,-7.139517 -3.050464,-0.870365c-2.648668,9.945445 -4.917691,19.78863 -2.154601,30.034594c-3.672033,2.893432 -10.75969,-13.464896 -7.499772,-19.739728c2.828124,-7.099908 2.199325,-14.346853 2.669953,-19.149688c2.585841,-5.417961 -2.515971,-11.305596 0.195953,-17.083429c-6.929892,7.277312 -13.127052,12.310894 -11.180369,23.727772c-0.860179,2.848016 2.888245,19.224563 0.500985,13.194188c-4.507167,-11.77222 -4.51063,-24.80992 -1.118811,-36.82209c0.004173,-9.168594 -7.715918,15.83317 -7.146022,3.578428c-0.730649,-9.242169 3.223657,-19.405062 6.968695,-26.712419c-4.263924,-4.887371 -18.074257,-1.424207 -11.540873,-11.799582c6.429663,-5.273246 5.740602,-12.524578 -3.010201,-6.148584c-13.512741,9.559705 -24.723732,21.841561 -37.111228,32.698279c11.901611,-14.736627 25.318798,-28.996916 41.925096,-38.883406c16.101296,-9.766515 39.448678,-10.776223 53.342148,3.219864c3.533845,5.995206 11.747792,9.969494 13.706292,15.366591c-1.439723,8.089564 3.982954,12.100823 4.565103,19.210866c3.421989,5.486314 -3.087356,15.349972 6.650037,12.506652c11.076702,-0.014996 26.235712,-2.37895 27.102185,-15.686171c4.420675,-19.165142 6.455761,-40.577044 20.611287,-55.829993c7.867249,-4.429973 2.980648,-3.25099 -2.768331,-3.980659c-5.082413,-5.697557 5.130078,-14.843732 10.157752,-15.886294c-0.867331,-13.465302 8.216865,8.072487 10.813765,-1.813913c3.896642,0.071381 5.796332,9.076748 8.165199,1.726402c7.064375,5.757773 14.530686,14.467467 5.199012,22.485943c10.616245,4.902352 -10.817548,1.727589 -1.673294,9.23836c7.546953,7.026101 2.212171,20.005275 -3.98297,25.661653c-0.240622,4.252929 7.263721,10.431738 8.772588,15.591319c7.795484,14.536196 9.358599,31.829868 6.370806,47.758911c-4.20676,15.013338 -19.86273,21.546541 -30.932475,31.084129c-9.455916,7.467106 -6.12885,20.56391 -10.605941,30.370064c0.445147,5.662463 3.726335,12.110635 8.388389,15.528781c6.756246,3.636767 14.671362,5.984553 20.1342,11.309195c-4.989238,2.509751 -15.161864,-7.676417 -15.260258,0.293134c-7.411721,-9.273979 -18.538193,-3.051054 -26.684743,-10.183141c6.779481,1.244474 15.591942,0.603067 8.167796,-7.22107c-2.931463,-6.616658 -11.760857,-8.90002 -11.995091,-16.896874c-8.31954,5.031049 -13.980625,11.880723 -20.021845,18.710306c-10.028971,-0.603458 -10.461389,18.869754 0.367875,18.580842c4.447335,1.095581 21.138557,7.064725 7.994783,5.52285c-3.917725,-0.674261 -8.167913,-3.035991 -8.048102,1.395365c-1.796577,-0.311271 -3.400547,-1.172049 -5.054381,-1.858848l0.000008,0z" fill-opacity="null" stroke-opacity="null" stroke-width="0" fill="#000000" />
<path id="rabbit" d="m135.150604,223.287924c-7.350276,-3.314624 2.24127,-9.941683 5.872563,-12.873183c2.445985,-2.257636 -14.018116,0.316697 -7.067116,-7.520464c7.626261,-6.402532 4.745461,-17.2342 -2.877498,-22.269164c-10.490784,-7.083503 -23.951131,-13.14599 -27.826812,-26.372818c-3.91889,-8.238404 5.374823,-16.915123 -0.602842,-24.354617c-4.811482,-9.659397 0.809696,-19.732124 4.303664,-28.680054c1.60679,-12.377645 -8.236113,-22.166008 -13.649102,-32.334929c-6.702512,-9.717651 -10.566147,-21.04095 -11.121343,-32.841172c-1.457619,-5.036835 0.15548,-12.858902 5.976028,-6.068231c12.189096,9.760145 25.570676,19.021346 34.101609,32.380629c1.614818,4.825481 8.080853,18.811106 8.441922,6.146325c0.169108,-17.406858 5.485566,-36.391639 19.108575,-48.056442c9.266133,-8.44327 14.263323,6.340556 14.695675,13.853136c2.411802,14.781604 -1.586049,29.439972 -6.041051,43.403205c-1.635477,6.489163 -5.894673,24.271838 6.252611,17.715065c27.982979,-10.803642 61.886436,0.543088 80.113343,23.751596c8.378749,11.237273 12.048105,25.674553 11.965264,39.536777c-4.314403,8.143992 11.715909,-0.152563 5.907303,9.24315c-3.419464,10.408211 -13.080794,16.055827 -19.848275,23.911885c-6.886465,6.295166 -1.776916,19.754503 -13.165135,21.737722c-16.616795,5.122544 -34.065795,7.366408 -51.364461,8.672489c-9.680282,1.98322 -14.378173,-9.085923 -5.099966,-13.687647c4.448226,-6.857304 17.174474,-7.337852 20.955695,-8.424173c-9.035882,0.884103 -20.179377,-2.803944 -27.79344,2.792125c-4.61117,7.485654 -8.304314,17.338401 -17.973989,19.47503c-4.345532,1.206902 -8.813515,2.174754 -13.263213,0.863754l-0.000007,0.000007z" fill-opacity="null" stroke-opacity="null" stroke-width="0" stroke="#000" fill="#fff" />
</svg>
@import url("https://fonts.googleapis.com/css2?family=Exo:wght@600&display=swap");
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
width: 100vw;
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
font-family: "Exo", Arial, sans-serif;
font-size: 20px;
font-weight: 600;
background: linear-gradient(to bottom, #0b0a27, #31304c 50%);
}
svg {
width: 50%;
}
path:not(#hippo) {
visibility: hidden;
}
var tl = gsap.timeline({
defaults: {
duration: 1
}
});
var hippo = document.getElementById("hippo");
tl.to(hippo, { morphSVG: "#elephant", duration: 1 }, "+=1")
.to(hippo, { morphSVG: "#cock", duration: 1 }, "+=1")
.to(hippo, { morphSVG: "#rabbit", duration: 1 }, "+=1")
.to(hippo, { morphSVG: hippo, duration: 1 }, "+=1");
GSDevTools.create();
Also see: Tab Triggers