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 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.
.flyer
h1 LADYGROOVE
.details__container
.details
p 1 HOUR SHOOT
br
p.nomargin SHEETS + LINGERIE
br
p ON A NUDE BODY
br
p 5 FINAL IMAGES
img src="https://images.unsplash.com/photo-1548460540-e685e7a59f0a?ixlib=rb-1.2.1&q=85&fm=jpg&crop=entropy&cs=srgb&ixid=eyJhcHBfaWQiOjE0NTg5fQ"
.photographer
span by
| ALLIE MONDAY
.price $750
h1.gold Sheets and
.tour-title
.road ROAD
h1.gold Lingerie
.tour TOUR
.time-slots
ul
li 9:00 AM
li 10:00 AM
li.middle
|
p.top RESERVE
p.mid YOUR
p.bot TIME SLOT
li 2:00 PM
li 4:00 PM
.where
.date 8.25.19
h1 418 GRANBY ST
h1 NORFOLK, VA
.sponsor
p.bold COVET
p ATELIER
@import url('https://fonts.googleapis.com/css?family=DM+Serif+Display|Nanum+Myeongjo|Tajawal&display=swap')
//COLOR SCHEME
$blush: #f3d3c5
$gold: #d4ab3a
$black: #000
//FONTS
$head: 'Nanum Myeongjo'
$details: 'Tajawal'
//reset
*
margin: 0
padding: 0
box-sizing: border-box
body
background: $gold
font-size: 18pt
.flyer
max-width: 1000px
margin: 10vh auto
padding: 50px
background: $blush
h1
text-align: center
font-family: $head
font-size: 4em
letter-spacing: 10px
margin-right: -10px
font-weight: 100
&.gold
color: $gold
.details__container
position: relative
width: 100%
text-align: center
& .details
position: absolute
top: 100px
left: 10px
text-align: right
font-family: $details
z-index: 9999
& p
display: inline-block
font-weight: bold
font-size: 1.2em
line-height: .8em
margin-bottom: 100px
border-bottom: 2px solid black
& p.nomargin
margin-bottom: 5px
& img
margin-top: -40px
width: 50%
opacity: .7
& .photographer
position: absolute
font-family: $head
font-size: .9em
top: -15px
right: 0
& span
font-family: $head
font-weight: bold
font-size: .7em
border-bottom: 2px solid #000
& .price
position: absolute
top: 275px
right: 25px
font-size: 3em
font-weight: 100
font-family: $details
letter-spacing: 10px
padding: 0 20px
z-index: 9999
&::before
content: ""
background: $gold
width: 100%
height: 40px
left: 0
bottom: 20px
position: absolute
z-index: -1
.tour-title
position: relative
& .road, .tour
position: absolute
top: 40px
color: $gold
font-size: 1em
letter-spacing: 10px
font-family: $details
border-bottom: 2px solid $gold
& .road
left: 130px
& .tour
right: 130px
ul
list-style-type: none
text-align: center
margin-top: 75px
li
display: inline-block
border: 2px solid $gold
border-bottom: 4px solid $gold
font-family: $details
color: $gold
width: 100px
text-align: center
padding: 5px 0 0 0
line-height: 1em
font-size: .8em
margin-right: 25px
li.middle
position: relative
border: none
& p
position: absolute
color: black
letter-spacing: 3px
&.top
top: -20px
left: -3px
font-size: 1.2em
&.mid
top: 5px
left: 25px
line-height: 1.2
font-family: $details
letter-spacing: 0
font-size: .9em
font-weight: bold
&.bot
bottom: -25px
left: -25px
width: 150px
.where
position: relative
margin-top: 75px
text-align: center
.date
position: absolute
font-family: $head
font-size: 2em
left: 100px
& h1
font-family: $details
font-size: 1em
color: $gold
letter-spacing: 10px
.sponsor
position: absolute
font-family: $head
font-size: 1em
top: 0
right: 130px
& .bold
letter-spacing: 10px
Also see: Tab Triggers