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 Skypack, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ES6 import
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 id="cloud01" class="clouds" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 651 339" width="651" height="339">
<g id="layer1" fill="#fff">
<path id="path2991" stroke="#000" stroke-width="3.961" d="M312.993 82.697c494.563 31.262 369.317 340.225 90.044 177.12"/>
<path id="path2993" stroke="#000" stroke-width="3.961" d="M291.1 241.27c8.543 128.342 193.713 67.49 164.415-15.073"/>
<path id="path2995" stroke="#000" stroke-width="3.961" d="M326.997 124.063c-542.074-70.883-274.534 259.2-130.78 164.048"/>
<path id="path2989" stroke="#000" stroke-width="3.961" d="M206.65 121.053c108.772-190.37 428.19-23.92 290.165 67.66"/>
<path id="path2993-1" stroke="#000" stroke-width="3.961" d="M162.802 253.18c5.08 137.576 187.57 83.87 164.415-15.073"/>
<path id="path2993-7" stroke="#000" stroke-width="3.961" d="M277.305 106.79C222.15-65.603-7.1 76.024 100.54 152.12"/>
<path id="path2993-7-4" stroke="#000" stroke-width="3.961" d="M454.895 103.894c36.867-123.23-157.893-130.958-159.31-43.36"/>
<path id="path3878" d="M200.258 123.23l214.91 3.664-1.22 107.456-275.966 31.748z"/>
</g>
</svg>
<svg id="cloud02" class="clouds" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 494 189" width="494" height="189">
<g id="layer1" fill="#fff">
<path id="path2991" stroke="#000" stroke-width="2.684" d="M353.322 86.835c230.176-17.896 135.722 115.67-5.31 55.623"/>
<path id="path2993" stroke="#000" stroke-width="2.684" d="M240.335 134.195c7.062 71.253 160.14 37.47 135.92-8.368"/>
<path id="path2995" stroke="#000" stroke-width="2.684" d="M270.01 69.125c-448.125-39.353-226.954 143.9-108.114 91.075"/>
<path id="path2989" stroke="#000" stroke-width="2.684" d="M123.077 69.488c81.844-88.742 401.423-15.314 287.32 35.53"/>
<path id="path2993-1" stroke="#000" stroke-width="2.684" d="M134.272 140.807c4.2 76.38 155.063 46.563 135.92-8.368"/>
<path id="path2993-7-4" stroke="#000" stroke-width="2.684" d="M375.74 57.927c30.48-68.414-130.526-72.704-131.697-24.073"/>
<path id="path3909" d="M136.407 93.305S321.51 47.338 325.547 49.37c4.038 2.035 77.728 73.216 77.728 73.216l-302.963 26.178z"/>
</g>
</svg>
<svg id="cloud03" class="clouds" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 335 185" width="335" height="185">
<g id="layer1" fill="#fff">
<g id="layer1-1" stroke="#000" stroke-width="3">
<path id="path2991" d="M208.94 59.26c206.214-24.96 121.593 161.344-4.755 77.588"/>
<path id="path2993" d="M107.716 125.322c6.327 99.387 143.47 52.265 121.77-11.672"/>
<path id="path2995" d="M134.302 34.558c-229.643-4.775-113.794 179.92-7.326 106.234"/>
<path id="path2989" d="M94.006 57.76c73.324-123.783 222.17-10.014 166.068 26.863"/>
</g>
<path id="path3947" d="M68.56 55.44l186.825-2.442v63.496L73.443 148.242z"/>
</g>
</svg>
<svg id="cloud04" class="clouds" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 335 185" width="335" height="185">
<g id="layer1" fill="#fff">
<g id="layer1-1" stroke="#000" stroke-width="3">
<path id="path2991" d="M208.94 59.26c206.214-24.96 121.593 161.344-4.755 77.588"/>
<path id="path2993" d="M107.716 125.322c6.327 99.387 143.47 52.265 121.77-11.672"/>
<path id="path2995" d="M134.302 34.558c-229.643-4.775-113.794 179.92-7.326 106.234"/>
<path id="path2989" d="M94.006 57.76c73.324-123.783 222.17-10.014 166.068 26.863"/>
</g>
<path id="path3947" d="M68.56 55.44l186.825-2.442v63.496L73.443 148.242z"/>
</g>
</svg>
body{
background: blue;
overflow:hidden;
}
.clouds{
position:absolute;
}
#cloud01 {
width: 300px;
height: auto;
top: 5px;
left: -300px;
}
#cloud02 {
width: 200px;
height: auto;
top: 90px;
left: -200px;
}
#cloud03 {
width: 80px;
height: auto;
top: 15px;
left: -80px;
}
#cloud04 {
width: 120px;
height: auto;
top: 150px;
left: -120px;
}
// play with TIME und RUN-positions
var ww = $(window).width() + 300;
var cloudTl = new TimelineMax({repeat:-1, force3D:true});
cloudTl.to("#cloud01", 22, {x:ww ,ease: Linear.easeNone}, 1)
.to("#cloud02", 19, {x:ww ,ease: Linear.easeNone}, 0.9)
.to("#cloud03", 18, {x:ww ,ease: Linear.easeNone}, 1)
.to("#cloud04", 21, {x:ww ,ease: Linear.easeNone}, 1.5);
//next step could be to put some RANDOM for TIME and ... to the sky (a function onRepeat or onUpdate)
Also see: Tab Triggers