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.
.profile
article
header
h1
.nth-line-1 A piece
.nth-line-2 of Pierce
p.lead A short talk with contemporary sculptural artist from Ireland
hr
section
p Sorem ipsum dolor sit amet, consectetur adipisicing elit. Est voluptate et asperiores. Consequatur beatae aperiam, dolore? Amet, a, unde. Accusamus repellat adipisci aut quasi quibusdam voluptate pariatur repellendus distinctio omnis, nulla iste soluta deserunt quae veniam reprehenderit. Ea dignissimos obcaecati dicta aliquam, suscipit maxime atque modi quas asperiores laboriosam assumenda quos deserunt tempore debitis facilis optio itaque autem quidem iusto quaerat nulla perferendis vero veritatis minus delectus! Natus quam ullam porro, blanditiis hic numquam, incidunt eligendi minus ab, soluta animi.
p Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quos sit, adipisci tempore molestiae, accusantium praesentium consequatur asperiores facilis ipsum mollitia autem. Aspernatur, reiciendis. Debitis ullam expedita voluptatibus illo sequi, ut cumque eaque quibusdam officiis pariatur, recusandae mollitia illum nostrum optio facere, at quisquam! Repellat adipisci ullam, soluta quo autem officia expedita itaque consectetur id accusantium et beatae animi nisi veniam sed accusamus voluptate necessitatibus maxime minus fugit sint, unde ratione placeat! Iste, possimus magni nihil? Accusantium, porro officia quidem eaque, libero placeat enim ipsa blanditiis quis ea beatae atque, aspernatur cumque quas laborum fugiat minima minus temporibus in deserunt.
blockquote Could be better, could be worse
p Lorem ipsum dolor sit amet, consectetur adipisicing elit. Cumque exercitationem delectus ipsam dolor, corporis iusto facere sint mollitia nemo aut. Excepturi rem tempore laborum mollitia explicabo sunt quisquam, ut provident, cum temporibus facere enim, facilis consequuntur nostrum porro corporis. Molestiae quam impedit consectetur facilis architecto nostrum voluptas, ducimus adipisci quos nulla, obcaecati culpa est totam rem harum laborum, asperiores quibusdam. Nam blanditiis ea temporibus delectus, quo officiis reprehenderit quasi illo praesentium magni amet laboriosam deserunt asperiores quidem. Odit, iure.
p Lorem ipsum dolor sit amet, consectetur adipisicing elit. Illo officiis ullam error necessitatibus ab non velit vero beatae illum temporibus. Laborum hic neque ut quidem. Consectetur quis, quod tenetur harum dolorem quia unde odit at blanditiis deserunt aspernatur incidunt placeat, magni mollitia similique, velit porro nobis vitae hic possimus. Dolorem, iusto eveniet. Magnam perspiciatis repellendus sequi, explicabo soluta quidem atque ex animi, autem doloremque delectus esse in consequatur. Ipsam in vero minus ad non sequi molestiae impedit a sit dignissimos? Quo repudiandae laborum minus, omnis voluptates praesentium officiis.
p Lorem ipsum dolor sit amet, consectetur adipisicing elit. Laudantium accusamus consectetur consequatur molestias, blanditiis placeat autem fugiat eligendi earum repellendus nihil sed, architecto.
p Lorem ipsum dolor sit amet, consectetur adipisicing elit. Debitis, quaerat, illo. Culpa?
p Autor Name
img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/5175/unsplash-music-01.jpg" alt="Guitar guy"
img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/5175/unsplash-tank-01.jpg" alt="Tank"
@import 'modular-scale'
@import url(https://fonts.googleapis.com/css?family=Old+Standard+TT:400|Lora:400)
$ms-base: 1em
$ms-ratio: $major-third
$yellow: #fcf704
$cement: #ccc
$black: #191919
=mq($w: 55em)
@media (min-width: $w)
@content
html
font: 400 1em/1.33 'Lora', serif
background-color: $black
body
padding-bottom: 3em
.profile
background: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/5175/unsplash-man-01.jpg') center 30%
height: 50vh
background-size: cover
+mq
width: 40%
position: fixed
top: 0
left: 0
bottom: 0
height: auto // reset
+mq(80em)
width: 50%
article
color: $cement
+mq
margin-left: 40%
position: relative
max-width: 66em
+mq(80em)
margin-left: 50%
header
text-align: center
padding: 0 2em
h1
font-family: 'Old Standard TT', serif
color: $yellow
text-transform: uppercase
font-weight: 400
.nth-line-1,
.nth-line-2
line-height: 1
.nth-line-1
font-size: 19vw
+mq
font-size: 10.5vw
.nth-line-2
font-size: 14.5vw
+mq
font-size: 8vw
.lead
color: $cement
font-size: ms(2)
max-width: 20em
margin: 0 auto
text-align: center
hr
border: none
background: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/5175/hr-01.png') no-repeat center
height: 40px
margin: 5em 0
section
column-width: 14em
column-gap: 1.33em
padding: 0 1em
+mq
padding: 0 3em
section p:first-of-type:first-letter
color: $yellow
float: left
font-size: 7em
line-height: 1
margin-top: -0.2em
margin-bottom: -0.2em
margin-right: 0.1em
p
+mq
// text-align: justify
img
max-width: 100%
margin-bottom: 1.33em
vertical-align: middle
blockquote
border-left: 0.2em solid $yellow
font-size: ms(3)
padding: 0.1em 0.5em
line-height: 1.5
margin-left: 0
margin-right: 0
quotes: "“" "”" "‘" "’"
&::before,
&::after
color: $yellow
font-size: ms(1)
line-height: 0
&::before
content: open-quote
&::after
content: close-quote
+mq
position: absolute
right: 100%
top: 80vh
width: 9em
background: $black
Also see: Tab Triggers