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 display="none">
<symbol viewBox="-32 0 480 480.011" id="tag">
<path d="m128.003906 280.011719c8.839844 0 16 7.164062 16 16 0 4.417969 3.582032 8 8 8 4.417969 0 8-3.582031 8-8-.054687-14.546875-9.914062-27.226563-24-30.863281v-9.136719c0-4.417969-3.582031-8-8-8-4.417968 0-8 3.582031-8 8v9.136719c-15.585937 4.011718-25.75 18.992187-23.71875 34.957031 2.03125 15.964843 15.625 27.925781 31.71875 27.90625 8.839844 0 16 7.164062 16 16 0 8.835937-7.160156 16-16 16-8.835937 0-16-7.164063-16-16 0-4.417969-3.582031-8-8-8-4.417968 0-8 3.582031-8 8 .054688 14.546875 9.917969 27.226562 24 30.863281v9.136719c0 4.417969 3.582032 8 8 8 4.417969 0 8-3.582031 8-8v-9.113281c15.636719-3.972657 25.851563-18.980469 23.816406-34.980469-2.035156-16.003907-15.683593-27.976563-31.816406-27.90625-8.835937 0-16-7.164063-16-16 0-8.835938 7.164063-16 16-16zm0 0" />
<path d="m152.003906 200.011719h-48c-4.417968 0-8 3.582031-8 8s3.582032 8 8 8h48c4.417969 0 8-3.582031 8-8s-3.582031-8-8-8zm0 0" />
<path d="m152.003906 424.011719h-48c-4.417968 0-8 3.582031-8 8s3.582032 8 8 8h48c4.417969 0 8-3.582031 8-8s-3.582031-8-8-8zm0 0" />
<path d="m406.347656 308.011719-117.445312-203.402344c7.226562-7.167969 13.621094-15.132813 19.054687-23.742187 13.335938-21.601563 15.71875-42.105469 6.703125-57.71875-17.941406-31.082032-74.605468-30.832032-129 .566406-7.222656 4.230468-14.167968 8.914062-20.796875 14.023437l-6.457031-7.328125c-7.699219-8.71875-18.769531-13.71875-30.402344-13.726562-11.628906.007812-22.699218 5.007812-30.398437 13.726562l-87.457031 99.105469c-6.539063 7.40625-10.148438 16.949219-10.14453175 26.832031v251.664063c.04687495 39.746093 32.25390575 71.957031 71.99999975 72h112c39.746094-.042969 71.957032-32.253907 72-72v-251.664063c-.015625-7.707031-2.238281-15.25-6.398437-21.738281h.0625c9.566406-5.53125 18.644531-11.863281 27.136719-18.925781l115.6875 200.328125c15.476562 26.785156 6.304687 61.042969-20.488282 76.511719l-96.992187 56c-4.265625 2.4375-8.839844 4.300781-13.597657 5.535156-4.269531 1.136718-6.8125 5.519531-5.675781 9.789062 1.132813 4.269532 5.515625 6.8125 9.789063 5.675782 6.101562-1.605469 11.96875-4.007813 17.445312-7.144532l96.992188-56c34.457031-19.871094 46.273437-63.917968 26.382812-98.367187zm-166.34375 100c-.035156 30.914062-25.085937 55.964843-56 56h-112c-30.910156-.035157-55.964844-25.085938-56-56v-251.664063c0-5.984375 2.183594-11.761718 6.144532-16.25l87.457031-99.09375c4.65625-5.285156 11.355469-8.316406 18.398437-8.320312 7.042969.003906 13.746094 3.035156 18.402344 8.320312l78.023438 88.421875c-17.835938 8.414063-37.328126 12.738281-57.046876 12.65625.363282-2.003906.570313-4.035156.621094-6.070312-.023437-22.082031-17.917968-39.972657-40-40-.878906.027343-1.746094.203125-2.566406.519531-4.03125-.496094-7.78125 2.144531-8.679688 6.105469-2.847656 10.933593-1.449218 22.539062 3.910157 32.484375 5.316406 8.804687 13.585937 15.433594 23.335937 18.699218-7.011718 6.398438-17.148437 8.035157-25.820312 4.175782-8.675782-3.863282-14.238282-12.492188-14.179688-21.984375 0-4.417969-3.582031-8-8-8-4.417968 0-8 3.582031-8 8-.019531 17.734375 11.652344 33.359375 28.667969 38.367187 17.011719 5.007813 35.289063-1.800781 44.878906-16.71875 3.148438.332032 6.3125.507813 9.480469.519532 22.332031-.675782 44.253906-6.195313 64.246094-16.175782 3.050781 4.164063 4.703125 9.183594 4.726562 14.34375zm-88-272c-.03125 1.171875-.148437 2.339843-.351562 3.496093-7.058594-1.835937-13.171875-6.253906-17.125-12.386718-2.46875-4.503906-3.527344-9.644532-3.042969-14.757813 11.75 1.722657 20.472656 11.773438 20.519531 23.648438zm89.65625-15.328125c-.796875.464844-1.597656.863281-2.398437 1.3125l-63.761719-72.265625c5.804688-4.402344 11.871094-8.449219 18.160156-12.121094 45.066406-26.03125 94.136719-28.972656 107.136719-6.398437 5.945313 10.28125 3.648437 24.960937-6.457031 41.320312-3.996094 6.347656-8.601563 12.289062-13.757813 17.734375l-.082031-.144531c-4.933594-8.558594-12.832031-15.019532-22.199219-18.167969l-31.328125-10.589844c-4.140625-1.261719-8.535156 1-9.914062 5.101563-1.382813 4.105468.753906 8.5625 4.820312 10.058594l31.328125 10.535156c5.667969 1.910156 10.445313 5.820312 13.4375 11l2.039063 3.527344c-8.394532 7.199218-17.441406 13.597656-27.023438 19.121093zm0 0" />
<path d="m273.078125 322.46875c2.207031 3.824219 7.101563 5.136719 10.925781 2.925781l55.425782-32c2.496093-1.417969 4.039062-4.066406 4.046874-6.9375.003907-2.871093-1.527343-5.523437-4.015624-6.953125-2.492188-1.429687-5.554688-1.417968-8.03125.035156l-55.425782 32c-3.824218 2.210938-5.136718 7.101563-2.925781 10.929688zm0 0" />
<path d="m283.207031 372.011719c2.203125 3.828125 7.097657 5.144531 10.925781 2.933593l69.28125-40c3.828126-2.207031 5.140626-7.101562 2.929688-10.929687-2.207031-3.828125-7.101562-5.140625-10.929688-2.933594l-69.28125 40c-3.824218 2.210938-5.136718 7.101563-2.925781 10.929688zm0 0" />
<path d="m287.726562 275.828125c1.402344 0 2.78125-.371094 4-1.074219l27.710938-16c2.496094-1.417968 4.039062-4.066406 4.046875-6.9375.003906-2.867187-1.527344-5.523437-4.015625-6.953125-2.488281-1.429687-5.554688-1.417969-8.03125.035157l-27.710938 16c-3.136718 1.8125-4.664062 5.5-3.726562 9 .9375 3.496093 4.105469 5.929687 7.726562 5.929687zm0 0" />
</symbol>
</svg>
<div class="container">
<svg class="tag-icon">
<use xlink:href="#tag"></use>
</svg>
</div>
.container {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.tag-icon {
width: 100px;
height: 100px;
fill: rgb(230, 19, 107);
}
.tag-icon:hover {
fill: darkorange;
cursor: pointer;
}
Also see: Tab Triggers