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 URL's 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 it's URL and the proper URL extention.
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.
<div class="jake">
<div class="ear left"></div>
<div class="ear right"></div>
<div class="face">
<div class="eyebrow left"></div>
<div class="eyebrow right"></div>
<div class="eye left"></div>
<div class="eye right"></div>
<div class="whiskers left"></div>
<div class="whiskers right"></div>
<div class="inner">
<div class="nose"></div>
<div class="mouth"></div>
</div>
</div>
</div>
<div class="origin" title="origin"></div>
<h1>14. Jake</h1>
<h2>CSS Drawing by Zinee</h2>
<div class="sns">
<a href="http://zinee-world.tistory.com" target="_blank" class="sns">blog</a>
<a href="https://facebook.com/zineeworld" target="_blank" class="sns">facebook</a>
<a href="https://twitter.com/zineeworld" target="_blank" class="sns">twitter</a>
</div>
@import url('https://fonts.googleapis.com/css?family=Oleo+Script:400,700|Roboto:400,700')
*, *:after, *:before
box-sizing: border-box
margin: 0
body
background: #fed4d8
h1
font-family: 'Oleo Script'
text-transform: uppercase
text-align: center
color: #000
h2
font-family: 'Roboto'
font-size: 16px
font-weight: normal
text-align: center
color: #444
.sns
text-align: center
a
display: inline-block
margin: 5px 2px
font-family: 'Roboto'
font-size: 14px
font-weight: 700
color: #000
.origin
position: fixed
top: 0
left: 0
width: 100px
height: 100px
background:
image: url('https://zinee91.dothome.co.kr/cssdrawing/1205.png')
repeat: no-repeat
position: center top
size: 100%
.jake
position: relative
margin: 20px auto
width: 394px
height: 390px
transform: scale(0.9)
.ear
position: absolute
top: 10px
width: 140px
height: 140px
border: 9px solid #000
border-radius: 15px
background: #d39775
&.left
left: 25px
transform: rotate(10deg) skew(10deg)
&.right
right: 25px
transform: rotate(-10deg) skew(-10deg)
&:before
content: ''
display: block
position: absolute
top: 20px
left: 0
right: 0
margin: 0 auto
width: calc(100% - 40px)
height: calc(100% - 40px)
border-radius: 2px
background: #fff
.face
position: absolute
bottom: 0
left: 0
right: 0
width: 100%
height: 370px
border-radius: 90% 90% 80% 80% / 100% 100% 63% 63%
border: 9px solid #000
background: #bb714e
.eyebrow
position: absolute
top: 120px
width: 30px
height: 12px
border-radius: 20px
background: #fff
&.left
left: 137px
transform: rotate(-13deg)
&.right
right: 137px
transform: rotate(13deg)
.eye
position: absolute
top: 147px
width: 17px
height: 22px
border-radius: 100%
background: #000
&.left
left: 144px
&.right
right: 144px
.whiskers
position: absolute
top: 180px
width: 30px
height: 38px
&:before,
&:after
content: ''
display: block
position: absolute
width: 100%
height: 9px
border-radius: 9px
background: #000
&:before
top: 0px
left: 0
transform: rotate(12deg)
&:after
bottom: 0
right: 0px
width: 86%
transform: rotate(-12deg)
&.left
left: 87px
&.right
right: 87px
&:before
transform: rotate(-12deg)
&:after
left: 0
right: auto
transform: rotate(12deg)
.inner
position: absolute
top: 164px
left: 0
right: 0
margin: 0 auto
width: 110px
height: 85px
border-radius: 100%
background: #fff
overflow: hidden
&:before,
&:after
content: ''
display: block
position: absolute
top: 1px
width: 50px
height: 10px
border-radius: 50%
background: #bb714e
&:before
left: 0px
transform: rotate(-20deg)
&:after
right: 0px
transform: rotate(20deg)
.nose
position: absolute
top: 10px
left: 0
right: 0
margin: 0 auto
width: 32px
height: 22px
border-radius: 22px
background: #000
z-index: 1
.mouth
&:before,
&:after
content: ''
display: block
position: absolute
top: 0px
width: 40px
height: 45px
border: 7px solid #000
border-width: 0 3.5px 7px 3.5px
border-radius: 50%
&:before
left: 21px
transform: rotate(-5deg)
&:after
right: 21px
transform: rotate(5deg)
Also see: Tab Triggers