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.
<center class='circle'>
<div class='back'></div>
<div class='step-1-container'>
<h2 class='sign-up'>SIGN UP</h2>
<label class='teacher'>
<input type='radio' name='account_type' value='teacher'/>
Teacher
</label>
<label class='student'>
Student
<input type='radio' name='account_type' value='student'/>
</label>
</div>
<div class='step-2-container'>
<i class="fa fa-lock"></i>
<div class='input-add-on'>
<input id='#access' type='text' placeholder='ACCESS CODE . . .'/>
<button class='add-on'>
ENTER
</button>
</div>
</div>
<div class='step-3-container'>
<div>
<i class='fa fa-edit'></i>
<input type='text' placeholder='Full Name' />
</div>
<div>
<i class='fa fa-user'></i>
<input type='text' placeholder='User Name' />
</div>
<div>
<i class='fa fa-lock'></i>
<input type='password' placeholder='Password' />
</div>
<div>
<i class='fa fa-check-circle-o'></i>
<input type='password' placeholder='Confirm Password' />
</div>
<button type='submit'>CREATE ACCOUNT</button>
</div>
<div class='steps'>
<div class='step-1'>1</div>
<div class='line-1'></div>
<div class='step-2'>2</div>
<div class='line-2'></div>
<div class='step-3'>3</div>
</div>
</center>
@import "nib"
@import url(https://fonts.googleapis.com/css?family=Open\+Sans:400,300,600,700,800)
@import url(http:////netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css)
*
box-sizing: border-box
body, html
font-family: "Open Sans"
color: rgba(white, .5)
rect(100%)
background: url(https://i.imgur.com/v6fQNxP.jpg)
background-size: cover
.input-add-on
position: relative
display: inline-block
.add-on
btn(#FFF)
padding: 0
border-radius: 0
position: absolute
height: 100%
width: 30%
right: 0
top: 0
font-weight: 700
font-size: 14px
border: 0
outline: 0
.back
transition: all .5s cubic-bezier(0.425, -0.395, 0.340, 1.420)
cursor: pointer
opacity: 0
circle(50px)
background: rgba(white, .12)
box-shadow: inset 0 1px rgba(white, .1), 0 1px 3px rgba(black, .1)
position: absolute
top: 50%
margin-top: -25px
margin-left: 0px
z-index: -1
&:hover
transition: all .2s cubic-bezier(0.210, -0.510, 0.740, 1.830) !important
transition-delay: 0 !important
transform: scale(1.1)
&:active
transform: scale(0.9)
&:after
content: ''
display: block
transform: rotate(45deg)
absCenter()
margin-left: 18px
height: 30%
width: 30%
box-shadow: 0px 1px rgba(0, 0, 0, 0.1), inset 1px 0px rgba(0, 0, 0, 0.2)
border-left: 6px solid rgba(white, .2)
border-bottom: 6px solid rgba(white, .2)
.circle
transform: translateZ(0px)
circle(400px)
absCenter()
background: rgba(white, .12)
box-shadow: inset 0 1px rgba(white, .3), 0 1px 5px rgba(black, .3)
text-shadow: 0 1px rgba(black, .1)
input[type='text'], input[type='password']
background: rgba(white, .05)
box-shadow: inset 0 0 3px rgba(black, .4)
border: 0
outline: 0
font-weight: 200
font-size: 13px
color: white
h2
margin: 80px 0 40px
font-size: 46px
.step-1-container
label
margin: 0 8px
btn()
btn-lg()
input
display: none
&.student
btn('primary')
btn-lg()
.step-2-container
.fa-lock
display: block
font-size: 120px
margin: 50px 0 10px
input[type='text']
width: 215px
padding: 15px 75px 15px 20px
.step-3-container
> div
display: inline-block
position relative
i
text-align: left
width: 25px
text-shadow: 1px 0 rgba(black, .2)
position: absolute
left: 12px
top: 8px
border-right: 2px solid rgba(white, .3)
input
display: block
margin: 0 auto
padding: 0 10px 0 50px;
height: 30px;
margin-bottom: 5px;
&:after
content: ''
display: block
height: 75%
border-left: 2px solid white
button
btn(#FFF)
width: 215px
margin-top: 5px
line-height: 30px
border-radius: 0
font-weight: 700
.step-2-container, .step-3-container
opacity: 0
position: absolute
top: -10px
left: 0; right: 0;
margin: auto
z-index: -1
dur = .7s
.steps
size = 44px
position: absolute;
bottom: 90px;
width: 100%;
font: 700 25px/39px "Open Sans"
div
display: inline-block
&[class^='line-']
width: 50px
border-bottom: 2px solid rgba(white, .2)
margin-bottom: 8px
position: relative
&:after
transition: width dur
border-bottom: 2px solid rgba(white, .9)
content: ' '
display: block
width: 0
position: absolute
&[class^='step-']
color: rgba(white, .2)
circle(size)
border: 2px solid rgba(white, .2)
transition: all dur
&:after
content: ''
transition: all dur
opacity: 0;
border-left: 6px solid rgba(white, .9)
border-bottom: 6px solid rgba(white, .9)
position: absolute
top: 35%
left: 27%
height: 15%
width: 35%
box-shadow: -1px 1px rgba(black, .2)
.circle-2
.back
margin-left: -70px
opacity: 1
&.transition .back
transition-delay: dur
.circle-3
.step-3-container
position: absolute
top: 60px
.add-on
transition: width 0.4s
width: 100%
for i in (2..4)
.circle-{i}
.step-{(i - 1)}-container
z-index: -1
opacity: 0
transition: all dur
pointer-events: none
.step-{i}-container
transition: opacity dur
transition-delay: dur - .2
opacity: 1
.steps
.step-{(i - 1)}
transition: all dur
border-color: transparent
background: #85C05F
box-shadow: -1px 1px rgba(black,.2)
transform: rotate(310deg)
color: transparent
text-shadow: none
&:after
opacity: 1
.line-{(i - 1)}:after
width: 100%
.step-{i}
transition-delay: .5s
border-color: rgba(white, .9)
color: rgba(white, .9)
var transEnd = 'transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd'
$(".step-1-container").bind(transEnd, function(el){
if(el.target == this) {
this.style.display = 'none';
$('.circle').removeClass('transition');
}
});
$(".input-add-on").bind(transEnd, function(el) {
if(el.target == this)
$('.step-2-container').css('display', 'none');
});
$('.step-1-container label').click(function() {
$('.circle').addClass('circle-2 transition');
$('label').each(function(i, el) {
if($(el).find('input').prop('checked'))
$(el).addClass('selected')
else
$(el).removeClass('selected')
});
});
$('.add-on').click(function(e) {
$('.circle').addClass('circle-3');
});
$('.back').click(function() {
if($('.circle').hasClass('circle-3')) {
$('.circle').removeClass('circle-3')
$('.step-2-container').css('display', 'block');
} else {
$('.circle').removeClass('circle-2')
$('.step-1-container').css('display', 'block');
}
});
Also see: Tab Triggers