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.
.tentD.container
.jellyfish
.middle
.ten
.a
.e
.b
.d
.c
.nine
.a
.e
.b
.d
.c
.eight
.a
.e
.b
.d
.c
.seven
.a
.e
.b
.d
.c
.six
.a
.e
.b
.d
.c
.five
.a
.e
.b
.d
.c
.four
.a
.e
.b
.d
.c
.three
.a
.e
.b
.d
.c
.two
.a
.e
.b
.d
.c
.one
.a
.e
.b
.d
.c
.tentacles
.tentA
.tentB
.tb1
.tentC
.tentD
.tentE
.body
.stripes01
.stripes02
$bodyHighlight: #af7ac5
$bodyBackground: #1f618d
$bodyGlow: #ff4bff
$tentacle: #00d4ff
$mid: #af7ac5
$midInner: #ff4bff
$midOuter: #00d4ff
$tentOpac: 0.4
body
background-color: #154360
.container
width: 1000px
height: 1000px
background-color: #154360
.jellyfish
transform: rotate(-15deg)
top: 50px
position: absolute
display: block
.body, .stripes01, .stripes02
position: absolute
display: block
height: 200px
background-color: $bodyBackground
border-radius: 50% 50% 20% 20% / 70% 70% 40% 40%
box-shadow: inset 0px 0px 30px $bodyHighlight, 0px 0px 6px 0px $bodyHighlight
.body
top: 100px
left: 100px
width: 300px
border-bottom: 4px solid $bodyHighlight
.stripes01, .stripes02
border-radius: 50% 50% 20% 20% / 70% 70% 40% 40%
border-left: 4px solid $bodyHighlight
border-right: 4px solid $bodyHighlight
.stripes01
width: 250px
left: 25px
.stripes02
width: 150px
left: 75px
.tentacles
top: 250px
position: absolute
display: block
left: 130px
.tentA, .tentB, .tb1, .tentC, .tentD, .tentE
border-radius: 100%
position: absolute
display: block
border: 10px solid transparent
.tentA
border-radius: 80% 100% 100% 100%
height: 250px
width: 220px
border-left-color: $tentacle
border-bottom-width: 0px
transform: rotate(25deg)
opacity: $tentOpac
.tentB
height: 300px
width: 200px
border-right-color: $tentacle
top: -50px
left: -150px
transform: rotate(-10deg)
opacity: $tentOpac
.tb1
height: 200px
width: 160px
border-left-color: $tentacle
border-bottom-width: 0px
left: 140px
top: 231px
transform: rotate(1deg)
.tentC
height: 400px
width: 150px
border-right-color: $tentacle
top: -100px
left: -20px
opacity: $tentOpac
border-bottom-width: 0px
.tentD
border-radius: 80% 100% 100% 100%
height: 350px
width: 220px
border-left-color: $tentacle
border-bottom-width: 0px
transform: rotate(25deg)
opacity: $tentOpac
left: 120px
top: -50px
.tentE
border-radius: 80% 100% 100% 100%
height: 280px
width: 250px
left: -30px
border-right-color: $tentacle
border-bottom-width: 0px
transform: rotate(-35deg)
opacity: $tentOpac
.middle, .one, .two, .three, .four, .five, .six, .seven, .eight, .nine, .ten
position: absolute
display: block
.middle
left: 200px
top: 290px
opacity: 0.7
.a, .b, .c, .d, .e
position: absolute
display: block
border-radius: 100%
//background: $mid
height: 100%
width: 30%
box-shadow: inset 0px 0px 0px $midInner, 0px 0px 20px 0px $midOuter
.a
left: -20%
.b
top: 10%
left: 5%
.c
top: 15%
left: 30%
.d
top: 10%
left: 55%
.e
left: 80%
.one
height: 30px
width: 100px
.a, .b, .c, .d, .e
background: $mid
.two
top: 20px
left: (100px-85)/2
height: 25.5px
width: 85px
.a, .b, .c, .d, .e
background: lighten($mid, 3%)
.three
top: 36.83px
left: (100px-72.25)/2
height: 21.67px
width: 72.25px
.a, .b, .c, .d, .e
background: lighten($mid, 6%)
.four
top: 50.3px
left: (100px-61.4)/2
height: 18.42px
width: 61.41px
.a, .b, .c, .d, .e
background: lighten($mid, 9%)
.five
top: 62.16px
left: (100px-52.2)/2
height: 15.66px
width: 52.2px
.a, .b, .c, .d, .e
background: lighten($mid, 12%)
.six
top: 72.49px
left: (100px-44.37)/2
height: 13.31px
width: 44.37px
.a, .b, .c, .d, .e
background: lighten($mid, 15%)
.seven
top: 81.27px
left: (100px-37.7)/2
height: 11.31px
width: 37.7px
.a, .b, .c, .d, .e
background: lighten($mid, 18%)
.eight
top: 88.73px
left: (100px-32.06)/2
height: 9.62px
width: 32.06px
.a, .b, .c, .d, .e
background: lighten($mid, 21%)
.nine
top: 95.08px
left: (100px-27.25)/2
height: 8.17px
width: 27.25px
.a, .b, .c, .d, .e
background: lighten($mid, 24%)
.ten
top: 99.67px
left: (100px-23.16)/2
height: 6.95px
width: 23.16px
.a, .b, .c, .d, .e
background: lighten($mid, 27%)
.tentA, .tentB, .tentC, .tentD, .tentE
animation: tents 3s infinite
@keyframes tents
0%
transform: scale(1.03, 0.95)
30%
transform: scale(1, 1.1)
35%
transform: scale(1, 1.1)
100%
transform: scale(1.03, 0.95)
.body
animation: body 3s infinite
@keyframes body
0%
transform: scale(1.005, 0.95)
top: 120px
30%
transform: scale(1, 1)
top: 100px
35%
transform: scale(1, 1)
top: 100px
100%
transform: scale(1.005, 0.95)
top: 120px
Also see: Tab Triggers