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.
doctype html
html lang="en"
head
meta charset="UTF-8"
title Calendar
link href="https://fonts.googleapis.com/css?family=Roboto+Condensed:400,300,700" rel="stylesheet" type="text/css"
body
header role="banner"
time
| August
em
| 2013
a href="#"
| Add event
section role="main"
ul.m-box--weeks
li Sun
li Mon
li Tue
li Wed
li Thu
li Fri
li Sat
ul.m-box--date
li.l-date--passed 28
li.l-date--passed 29
li.l-date--passed 30
li.l-date--passed 31
li 1
li 2
li 3
ul.m-box--date
li 4
li 5
li 6
li.l-date--event data-event="15:00 - New Haircut"
i.m-bullet--event>
| 7
li 8
li 9
li 10
ul.m-box--date
li 11
li 12
li 13
li 14
li 15
li 16
li 17
ul.m-box--date
li 18
li 19
li 20
li 21
li 22
li 23
li 24
ul.m-box--date
li 25
li 26
li 27
li 28
li 29
li 30
li 31
@import compass
/* Dirty ! Dirty ! Dirty ! (Code smell according @_flexbox) */
*
margin: 0
padding: 0
html
background: #249991
body
margin: 5% auto 0
width: 280px
time
color: white
text-transform: uppercase
font-weight: 300
font-size: 38px
em
display: block
font-weight: 300
font-style: normal
font-size: 16px
header
padding: 50px 0
background: #4ecdc4
text-align: center
font-family: 'Roboto Condensed', sans-serif
a
display: inline-block
padding: 5px 20px
border-radius: 20px
background: #44b3ab
color: white
text-decoration: none
text-transform: uppercase
font-weight: 300
font-size: 12px
transition: all .3s ease-in-out
&:hover
background: #249991
color: #ccc
[role="main"]
overflow: hidden
padding: 15px
background: white
font-family: 'Helvetica'
section
ul
list-style-type: none
li
position: relative
display: inline-block
float: left
width: 35px
height: 35px
text-align: center
line-height: 35px
zoom: 1
*display: inline
.l-date--event
cursor: pointer
transition: background .3s ease-in-out
&:hover
background: #efefef
.m-bullet--event
position: absolute
top: 5px
right: 5px
display: block
width: 5px
height: 5px
border-radius: 50%
background: #ff6b6b
.m-box--weeks
color: #e66b6b
text-transform: uppercase
font-weight: bold
font-size: 10px
.m-box--date
color: #555
font-size: 14px
.l-date--passed
color: #bababa
.eventTip
position: absolute
width: 150px
left: 50%
top: -125%
margin-left: -75px
background: #249991
color: white
&:before
content: '\25BE'
position: absolute
font-size: 25px
color: #249991
bottom: -19px
left: 46%
$('.l-date--event').on('mouseenter', function(){
var EventTip = $('<span class="eventTip" />');
var EventDescribe = $(this).attr('data-event');
EventTip.html(EventDescribe);
$(this).append(EventTip);
});
$('.l-date--event').on('mouseleave', function(){
$('.eventTip').remove();
});
Also see: Tab Triggers