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.
.member
%header.member-header
.member-header__container.mdl-layout--fixed-header.mdl-layout--fixed-tabs
%div.member-header__head
.member-header__head__back-btn
%button.mdl-button.mdl-js-button.mdl-button--icon
%i.material-icons keyboard_backspace
%h2.member-header__head__title Staff
.member-header__head__search-btn
%button.mdl-button.mdl-js-button.mdl-button--icon
%i.material-icons search
.member-header__head__menu-btn
%button.mdl-button.mdl-js-button.mdl-button--icon
%i.material-icons more_vert
.member-header__nav.mdl-tabs.mdl-js-tabs.mdl-js-ripple-effect
.mdl-tabs__tab-bar
%a.mdl-tabs__tab.mdl-layout__tab.is-active{:href => ""} Active
%a.mdl-tabs__tab.mdl-layout__tab{:href => ""} Invited
%a.mdl-tabs__tab.mdl-layout__tab{:href => ""} Disabled
%main.member-content
%section.member-list
%div.member-list__item.active
%span.member-list__item__name Alice Doe
%span.member-list__item__admin Admin
%div.member-list__item
%span.member-list__item__name Rohan Smith
%section.member-data
%h1.member-data__name Alice Doe
%div.mdl-tabs.mdl-js-tabs.mdl-js-ripple-effect
%nav.member-data__navigation.mdl-tabs__tab-bar
%a.member-data__navigation__item.mdl-tabs__tab.mdl-layout__tab.is-active{:href => ""} Profile
%a.member-data__navigation__item.mdl-tabs__tab.mdl-layout__tab{:href => ""} Reports
%a.member-data__navigation__item.mdl-tabs__tab.mdl-layout__tab{:href => ""} Sales
.member-data-content
%img{:src => "", :alt => ""}/
%h5.member-data__hi Meet Alice!
%p.member-data__info
Alice was last active on the 23rd of May 2015
and made
%span.member-data__info__money R450.95
in card transactions in the last month.
%section.member-data__actions
.member-data__actions__item
%i.icon.material-icons message
%span.text SMS
.member-data__actions__item
%i.icon.material-icons call
%span.text Call
.member-data__actions__item
%i.icon.material-icons mode_edit
%span.text Edit
.member-data__actions__item
%i.icon.material-icons clear
%span.text Disable
$back-background-color: #a8def3
$header-background-color: #00a2e0
$width: 1200px
body
background-color: $back-background-color
.member
background-color: white
width: $width
margin: 40px auto
position: relative
/* Header */
.member-header
background-color: $header-background-color
color: white
.member-header__container
width: 450px
padding-top: 25px
.member-header__head
display: flex
align-items: center
> .member-header__head__back-btn,
> .member-header__head__search-btn,
> .member-header__head__menu-btn
flex-basis: 15%
text-align: center
> .member-header__head__title
font-size: 20px
flex-basis: 55%
margin: 0
.member-header__nav .mdl-tabs__tab
color: rgba(white, 0.5) !important
font-weight: 500
font-size: 13px
text-transform: uppercase
padding: 0 16px
border-bottom: 3px solid transparent
&.is-active:after
background: white !important
&.is-active
color: white !important
/* Main content */
.member-content
display: flex
height: 600px
background-color: #f7f7f7
.member-list
width: 450px
display: flex
flex-direction: column
padding-top: 20px
.member-list__item
display: flex
height: 75px
align-items: center
padding-left: 30px
font-size: 18px
box-shadow: 0 2px 0 #f0f0f0
&.active
background-color: white
.member-list__item__name
flex-basis: 60%
.member-list__item__admin
background-color: #6ccb59
font-size: 13px
color: white
padding: 2px 15px
border-radius: 5px
.member-data
background-color: white
margin-right: 20px
margin-bottom: 20px
position: absolute
top: 10px
left: 0
right: 0
bottom: 0
margin-left: 450px
box-shadow: 0 0 6px rgba(black, 0.2)
border-radius: 2px
padding: 0 40px
.member-data__name
font-size: 22px
margin-bottom: 12px
.member-data__navigation
border-bottom: none
.member-data__navigation__item
font-weight: 500
font-size: 13px
text-transform: uppercase
.member-data__navigation__item:after
background-color: $header-background-color !important
.member-data-content
margin-top: 220px
display: flex
flex-direction: column
.member-data__hi
text-align: center
font-size: 16px
.member-data__info
text-align: center
width: 220px
margin: 10px auto
.member-data__info__money
color: #7dd16c
.member-data__actions
display: flex
flex-direction: row
margin: 80px auto 0 auto
.member-data__actions__item
display: flex
flex-direction: column
text-align: center
color: #888e93
padding: 0 30px
border-right: 1px solid rgba(#888e93, 0.2)
cursor: pointer
> .icon
margin-bottom: 10px
Also see: Tab Triggers