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.
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris.</p>
<div style="text-align: center;">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="150px" height="150px" viewBox="0 0 2000 2000" version="1.1">
<g id="surface1">
<path class="color-change" style=" stroke:none;fill-rule:nonzero;fill:rgb(100%,47.843137%,34.901961%);fill-opacity:1;" d="M 1501.796875 677.03125 L 1501.796875 442.109375 C 1565.15625 412.5 1605.78125 349.0625 1606.09375 279.140625 L 1606.09375 273.75 C 1606.09375 173.828125 1525.15625 92.8125 1425.234375 92.8125 L 1419.84375 92.8125 C 1320 92.8125 1238.984375 173.828125 1238.984375 273.75 L 1238.984375 279.140625 C 1239.296875 349.0625 1279.921875 412.5 1343.28125 442.109375 L 1343.28125 677.03125 C 1254.0625 690.703125 1170.078125 727.65625 1099.765625 784.21875 L 455.546875 282.5 C 460.15625 265.9375 462.578125 248.90625 462.8125 231.71875 C 463.046875 119.21875 371.953125 27.734375 259.375 27.578125 C 146.796875 27.34375 55.46875 118.515625 55.234375 231.015625 C 55.078125 343.59375 146.25 435 258.75 435.15625 C 294.0625 435 328.671875 425.546875 359.140625 407.8125 L 993.4375 901.40625 C 876.875 1077.578125 879.921875 1307.1875 1001.328125 1480.15625 L 808.359375 1673.125 C 792.8125 1668.125 776.5625 1665.46875 760.15625 1665.234375 C 667.8125 1665.3125 592.890625 1740.3125 592.96875 1832.65625 C 592.96875 1925.078125 667.890625 1999.921875 760.234375 2000 C 852.65625 2000 927.578125 1925.15625 927.65625 1832.734375 C 927.421875 1816.40625 924.765625 1800.15625 919.765625 1784.53125 L 1110.625 1593.59375 C 1281.171875 1724.921875 1515.390625 1736.25 1697.8125 1621.953125 C 1880.15625 1507.734375 1972.265625 1292.03125 1928.515625 1081.328125 C 1884.84375 870.625 1714.609375 709.296875 1501.796875 677.03125 M 1422.734375 1449.53125 C 1326.71875 1452.109375 1236.875 1402.34375 1188.125 1319.609375 C 1139.375 1236.875 1139.375 1134.21875 1188.125 1051.484375 C 1236.875 968.75 1326.71875 919.0625 1422.734375 921.640625 C 1564.84375 926.5625 1677.421875 1043.203125 1677.5 1185.390625 C 1677.578125 1327.5 1565.078125 1444.21875 1422.96875 1449.375 "/>
</g>
</svg>
</div>
<p>Curabitur sodales ligula in libero. Sed dignissim lacinia nunc. Curabitur tortor. Pellentesque nibh. Aenean quam. In scelerisque sem at dolor. Maecenas mattis. Sed convallis tristique sem. Proin ut ligula vel nunc egestas porttitor. Morbi lectus risus, iaculis vel, suscipit quis, luctus non, massa.</p>
Also see: Tab Triggers