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.
<!-- DAILY CSS IMAGES 5 - DORY -->
<div class="canvas">
<!-- HEAD -->
<div class="head">
<div class="head-copy"></div>
<!-- EYES -->
<div class="eyes">
<div class="left">
<div class="iris">
<div class="pupil">
<div class="light"></div>
</div>
</div>
</div>
<div class="right-copy"></div>
<div class="right">
<div class="iris">
<div class="pupil">
<div class="light"></div>
</div>
</div>
</div>
</div>
<!-- FRECKLES -->
<div class="freckles">
<div class="F1"></div>
<div class="F2"></div>
<div class="F3"></div>
<div class="F4"></div>
<div class="F5"></div>
<div class="F6"></div>
</div>
<!-- MOUTH -->
<div class="mouth">
<div class="teeth"></div>
<div class="tongue"></div>
</div>
<!-- FINS -->
<div class="fins-top">
<div class="top"></div>
<div class="under"></div>
</div>
<div class="big-fin">
<div class="big-fin-copy"></div>
</div>
<div class="fins-sides">
<div class="left"></div>
<div class="right"></div>
</div>
</div>
</div>
$bg: #2299d5
$black: #373737
$blue: #46A3F4
$darkblue: #3C8BD1
$yellow: #F7E633
$purple: #E85DBA
$red: #E3663B
$shadow: #3479B5
*
box-sizing: border-box
body, html
height: 100%
width: 100%
background: $darkblue
.canvas
position: relative
top: 20%
margin: auto
height: 300px
width: 350px
background: $darkblue
/*================ H E A D ================*/
%head
position: absolute
background: $blue
.head
@extend %head
top: 10%
left: 25%
height: 66.6%
width: 54.3%
border-radius: 50%
z-index: 1
box-shadow: 0 0 15px 5px $shadow
.head-copy
@extend %head
height: 100%
width: 100%
border-radius: 50%
z-index: 2
border-left: 13px solid $darkblue
border-right: 13px solid $darkblue
/*================ E Y E S ================*/
%eyes
position: absolute
top: 15%
height: 50%
width: 50%
border-radius: 50%
z-index: 3
background: #fff
border-top: 1px solid $blue
%iris
position: absolute
top: 8%
height: 80%
width: 80%
border-radius: 50%
background: $purple
z-index: 4
%pupil
position: absolute
top: 10%
height: 80%
width: 80%
border-radius: 50%
background: $black
%light
position: absolute
top: 10%
right: 10%
height: 20%
width: 20%
border-radius: 50%
background: #fff
z-index: 4
.eyes
.left
@extend %eyes
left: -5%
border-left: 5px solid $blue
border-right: 5px solid $darkblue
border-bottom: 2px solid $darkblue
.iris
@extend %iris
right: 0
.pupil
@extend %pupil
right: 0
.light
@extend %light
.right
@extend %eyes
right: -5%
border-right: 5px solid $blue
border-left: 5px solid $darkblue
border-bottom: 2px solid $darkblue
.iris
@extend %iris
left: 0
.pupil
@extend %pupil
left: 0
.light
@extend %light
/*================ F R E C K L E S ================*/
%freckles
position: absolute
border-radius: 50%
background: $darkblue
z-index: 4
.freckles
position: absolute
top: 50%
left: 30%
height: 20%
width: 40%
z-index: 3
.F1
@extend %freckles
top: 0
left: 50%
height: 5px
width: 5px
.F2
@extend %freckles
top: 26%
left: 35%
height: 4px
width: 4px
.F3
@extend %freckles
top: 22%
left: 50%
height: 3px
width: 3px
.F4
@extend %freckles
top: 30%
left: 58%
height: 3px
width: 3px
.F5
@extend %freckles
top: 40%
left: 43%
height: 4px
width: 4px
.F6
@extend %freckles
top: 54%
left: 55%
height: 3px
width: 3px
/*================ M O U T H ================*/
.mouth
position: absolute
left: 35%
bottom: 20%
z-index: 3
height: 10%
width: 30%
background: $black
border-radius: 10% 10% 50% 50%
.teeth
position: relative
margin: auto
height: 4px
width: 40%
background: #fff
border-radius: 0 0 20% 20%
.tongue
position: absolute
bottom: 0
left: 25%
height: 6px
width: 50%
background: $red
border-radius: 50% 50% 30% 30%
/*================ F I N S ================ */
%fins
position: absolute
height: 0
width: 0
z-index: 1
.fins-top
.top
@extend %fins
top: -5%
left: 39%
background: $black
height: 40px
width: 40px
border-radius: 10%
transform: rotate(45deg)
.under
@extend %fins
top: -9%
left: 42.5%
border-bottom: 30px solid $blue
border-left: 13px solid transparent
border-right: 13px solid transparent
.big-fin
@extend %fins
top: -10%
left: -15%
height: 100px
width: 100px
background: $black
border-radius: 30% 30% 20% 20%
border-left: 10px solid $darkblue
border-right: 10px solid $darkblue
border-top: 50px solid $yellow
transform: rotate(-60deg)
.big-fin-copy
position: absolute
top: -40%
height: 100%
width: 100%
border-radius: 60% 60% 0 0
background: $black
%fins-sides
position: absolute
bottom: 10%
height: 30px
width: 80px
background: $blue
box-shadow: -5px 5px 10px $shadow
.fins-sides
z-index: 1
.left
@extend %fins-sides
left: -26%
background: $black
border-right: 20px solid $blue
border-left: 30px solid $yellow
border-radius: 20% 40% 20% 80%
transform: rotate(-10deg) rotateY(40deg)
.right
@extend %fins-sides
right: -26%
background: $black
border-left: 20px solid $blue
border-right: 30px solid $yellow
border-radius: 40% 10% 80% 20%
transform: rotate(10deg) rotateY(-40deg)
Also see: Tab Triggers