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.
.grid
.nav
h2.border Futuristic todo app !
.links
a(href="").first About
a(href="").second Contact
.cards
.card.card-learn.learn.bg
h3 Learn about blockchain<br>Tech.
.card.card-download.bg
h3 Download some kno-<br>wledge.
.add.border
h3 Add new Task:
.input-field
input(type="text", placeholder="Task...")
button(type="submit")
i.fa.fa-angle-right
.card.card-design.bg
h3 Design a todo list app.
.card.card-get.bg
h3 Get a neuralink chip.
.card.card-train.bg
h3 Train a LSTM RNN to gene-<br>rate quotes.
.card.card-learn-js.learn.bg
h3 Learn Js.
.card.card-visit.bg
h3 Visit Mars.
button, input
&:focus
outline: none
.grid
max-width: 960px
margin: 0 auto
padding: 3rem 0
.border
//border: 1px solid #212121
.nav
display: grid
grid-template-columns: repeat(12, 1fr)
grid-template-rows: repeat(3, 2fr)
margin-bottom: 2rem
@media screen and (max-width: 900px)
padding-left: 1rem
h2
grid-column: 1/8
margin: 0
@media screen and (max-width: 900px)
grid-column: 1/13
grid-row: 1/2
margin-bottom: 1rem
.links
grid-column: 8/12
text-align: right
@media screen and (max-width: 900px)
grid-column: 1/13
grid-row: 2/3
text-align: left
a
font-weight: bold
color: #6f6f6f
transition: .5s
text-decoration: none
&:hover
color: #212121
transition: .5s
&:first-child
margin-right: .6rem
.cards
display: grid
grid-template-columns: repeat(12, 1fr)
grid-template-rows: repeat(5, 2fr)
@media screen and (max-width: 900px)
grid-template-rows: repeat(9, 2fr)
.bg
background-color: #fff
box-shadow: 0px 1px 12px 0px rgba(74, 74, 74, 0.34)
cursor: pointer
transition: .5s
@media screen and (max-width: 900px)
margin-bottom: 1rem
&:hover
box-shadow: 0px 1px 20px 0px rgba(74, 74, 74, 0.64)
transition: .5s
.card
padding: 1rem 2rem 4rem 1rem
.learn
background-image: linear-gradient(147deg, #FFE53B 0%, #FF2525 74%)
color: #fff
.card-learn
grid-column: 1/6
@media screen and (max-width: 900px)
grid-column: 1/13
grid-row: 8/9
.card-download
grid-column: 6/9
word-break: break-all
grid-row: 1/3
z-index: 1
background-image: linear-gradient(147deg, #8addd3 0%, #555dd9 74%)
color: #fff
@media screen and (max-width: 900px)
grid-column: 1/13
grid-row: 2/3
.add
grid-column: 9/13
padding: 2rem .5rem 2rem 1rem
z-index: 1
@media screen and (max-width: 900px)
grid-column: 1/13
grid-row: 1/2
input
box-shadow: 0px 1px 12px 0px rgba(74, 74, 74, 0.34)
border: 2px solid #d2d2d2
padding: .7rem 0 .8rem .7rem
border-radius: 5px
button
cursor: pointer
border: none
border-radius: 100%
padding: 1rem 1.3rem
position: relative
right: 18px
background-image: linear-gradient(147deg, #FFE53B 0%, #FF2525 74%)
box-shadow: 0px 2px 16px 0px rgba(255, 37, 37, 0.55)
color: #fff
.card-design
grid-column: 1/6
grid-row: 2/4
z-index: 1
background-image: linear-gradient(19deg, #21D4FD 0%, #B721FF 100%)
color: #fff
@media screen and (max-width: 900px)
grid-column: 1/13
grid-row: 3/4
.card-get
grid-column: 9/12
grid-row: 2/3
background-image: linear-gradient(180deg, #A9C9FF 0%, #FFBBEC 100%)
color: #212121
@media screen and (max-width: 900px)
grid-column: 1/13
grid-row: 4/5
.card-train
grid-column: 6/10
grid-row: 3/5
z-index: 1
background-image: linear-gradient(147deg, #f35240 0%, #dd2235 74%)
color: #fff
@media screen and (max-width: 900px)
grid-column: 1/13
grid-row: 5/6
.card-learn-js
grid-column: 4/6
grid-row: 4/6
@media screen and (max-width: 900px)
grid-column: 1/13
grid-row: 6/7
.card-visit
grid-column: 10/12
grid-row: 3/5
background-image: linear-gradient(62deg, #FBAB7E 0%, #F7CE68 100%)
color: #212121
@media screen and (max-width: 900px)
grid-column: 1/13
grid-row: 7/8
Also see: Tab Triggers