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.
<!--HEADER-->
<header>
<div class="container">
<div class="row">
<div class="twelve columns">
<nav>
<ul>
<li><a href="#">About</a></li>
<li><a href="#">Work</a></li>
<li><a href="#">Writing</a></li>
<li><a href="#">Contact</a></li>
</ul>
</nav>
</div>
</div>
<div class="row">
<div class="twelve columns">
<h1>- Design What You Imagine -</h1>
<h4>Phasellus ullamcorper ipsum rutrum nunc. Nunc nonummy metus. Vestibulum volutpat pretium libero. Cras id dui.</h4>
<a href="#" class="btn">Hire me</a>
</div>
</div>
<section class="services">
<div class="row">
<div class="twelve columns">
<h3>My areas of expertise</h3>
</div>
</div>
<div class="row">
<div class="one-half column">
<a href="#">
<h4>Graphic Design</h4>
<span class="fa fa-picture-o"></span>
<p>Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.
Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem.</p>
</a>
</div>
<div class="one-half column">
<a href="#">
<h4>Web Design</h4>
<span class="fa fa-leaf"></span>
<p>Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.
Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem.</p>
</a>
</div>
</div><!--end of .row-->
</section>
</div><!--end of .container-->
</header>
<!--ABOUT-->
<section class="about">
<div class="container">
<div class="row">
<div class="twelve columns">
<h3>Who am I</h3>
</div>
</div><!--end of .row-->
<div class="row bottom">
<div class="two-thirds column">
<p>Etiam rhoncus. Maecenas tempus, tellus eget condimentum rhoncus, sem quam semper libero,
sit amet adipiscing sem neque sed ipsum. Nam quam nunc, blandit vel, luctus pulvinar, hendrerit id, lorem.</p>
<p>Maecenas nec odio et ante tincidunt tempus. Donec vitae sapien ut libero venenatis faucibus. Nullam quis ante. Etiam sit amet orci eget eros faucibus tincidunt. Duis leo. Sed fringilla mauris sit amet nibh.
Donec sodales sagittis magna. Sed consequat, leo eget bibendum sodales, augue velit cursus nunc</p>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.
Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim.</p>
<p>Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus.</p>
</div>
<div class="one-third column">
<h4>Degrees</h4>
<ul>
<li>BA in Information Systems</li>
<li>MSc in Applied Mathematics </li>
<li>Phd in Artificial Intelligence</li>
</ul>
<h4>Honors</h4>
<ul>
<li>1st place in the contest "MyContest"</li>
<li>Best Paper for 2014</li>
</ul>
<a href="#" class="btn">CV</a>
</div>
</div><!--end of .row-->
<div class="row">
<div class="twelve columns">
<h4 class="center">Interested in samples of my work?</h4>
</div>
</div><!--end of .row-->
<div class="row">
<div class="twelve columns">
<a href="#" class="btn block">Visit Codepen</a>
</div>
</div><!--end of .row-->
</div><!--end of .container-->
</section>
<!--CONTACT-->
<section class="contact">
<div class="container">
<div class="row">
<div class="twelve columns">
<h3>Contact</h3>
</div>
</div><!--end of .row-->
<div class="row">
<div class="offset-by-two eight columns">
<ul>
<li><a href="#" title=""><span class="fa fa-facebook"></span></a></li>
<li><a href="#" title=""><span class="fa fa-twitter"></span></a></li>
<li><a href="#" title=""><span class="fa fa-dribbble"></span></a></li>
<li><a href="#" title=""><span class="fa fa-linkedin"></span></a></li>
<li><a href="#" title=""><span class="fa fa-github"></span></a></li>
</ul>
</div>
</div><!--end of .row-->
<div class="row">
<div class="twelve columns">
<a href="#" class="btn block btn-blue">Mail me</a>
</div>
</div><!--end of .row-->
<div class="row">
<div class="twelve columns">
<p class="creator">A demo by George Martsoukos. <a href="http://www.sitepoint.com/getting-started-with-skeleton-simple-css-boilerplate">See article</a>.</p>
</div>
</div><!--end of .row-->
</div><!--end of .container-->
</section>
/* GENERAL STYLES
–––––––––––––––––––––––––––––––––––––––––––––––––– */
body {
background: #FDD761;
font-family: 'Lucida Sans Unicode', 'Arial', serif;
color: white;
}
h1, h3, h4, header .btn {
font-weight: 700;
}
h1 {
margin: 100px 0 20px;
text-transform: uppercase;
font-size: 2.6rem;
}
h3 {
margin-bottom: 25px;
font-size: 2.3rem;
text-align: left;
}
h4 {
font-size: 2rem;
}
h3:after {
content: '';
display: block;
width: 10%;
padding-top: 5px;
border-bottom: 3px solid whitesmoke;
}
h1 + h4 {
font-weight: normal;
}
a {
text-align: center;
outline: none;
display: inline-block;
text-decoration: none;
background: #fcca2f;
font-size: 14px;
color: steelblue;
text-shadow: 0px 1px 0px rgba(0, 0, 0, 0.25);
-webkit-transition: all ease .3s;
transition: all ease .3s;
}
.btn {
font-size: 1.2em;
border-radius: 5px;
padding: 12px 30px;
}
.block {
width: 130px;
margin: 0 auto;
display: block;
}
/* HEADER STYLES
–––––––––––––––––––––––––––––––––––––––––––––––––– */
header .btn {
text-transform: uppercase;
}
header a:hover, .about a:hover {
background: #fcc316;
}
header .btn, .services {
margin-top: 100px;
}
header {
padding: 80px 0 150px;
}
.about, .contact {
padding: 150px 0;
}
header {
background: url("https://unsplash.it/1080/720/?image=377") no-repeat fixed center / cover;
text-align: center;
}
nav ul, .contact ul {
list-style: none;
font-size: 0;
}
nav li, .contact li {
margin-bottom: 0;
display: inline-block;
}
nav li {
width: 50%;
}
nav a {
position: relative;
width: 100%;
height: 30px;
padding: 7px 0;
line-height: 30px;
}
nav li:nth-child(2n+1) a:after {
position: absolute;
content: '';
top: 19.5px;
right: -2.5px;
z-index: 10;
border-radius: 100%;
background: steelblue;
width: 5px;
height: 5px;
}
/* SERVICES STYLES
–––––––––––––––––––––––––––––––––––––––––––––––––– */
.services a {
padding: 25px;
background: #fafafa;
margin-top: 20px;
border-radius: 4px;
}
.services a:hover {
color: black;
}
.services span {
font-size: 5.5em;
color: #f4ba04;
}
.services a:hover span {
color: white;
}
.services p {
margin: 15px 0 0;
}
/* ABOUT STYLES
–––––––––––––––––––––––––––––––––––––––––––––––––– */
.about {
background: url("https://unsplash.it/1080/720/?image=349") no-repeat fixed center / cover;
color: black;
}
.about .one-third,
.about .two-thirds {
background: white;
background: rgba(255,255,255,.3);
padding: 10px;
border-radius: 5px;
}
.about .one-third {
margin-top: 20px;
}
.about a {
margin-top: 10px;
}
.about ul {
margin-bottom:18px;
}
.about h3:after, .contact h3:after {
border-color: black;
}
.about .center {
text-align: center;
}
.about .bottom {
margin-bottom: 20px;
padding-bottom: 20px;
}
.about .one-third a {
margin: 10px auto;
width: 50%;
display: block;
}
.about .two-thirds p:last-child {
margin-bottom: 0;
}
/* CONTACT STYLES
–––––––––––––––––––––––––––––––––––––––––––––––––– */
.contact {
color: black;
text-align: center;
}
.contact p {
margin: 70px 0 0;
}
.contact ul a {
margin-top: 50px;
box-shadow: none;
background: none;
margin-left: 30px;
}
.contact li:nth-child(1) a {
margin-left: 0;
}
.contact span {
font-size: 2em;
color: white;
-webkit-transition: color ease .4s;
transition: color ease .4s;
}
.contact span:hover {
color: steelblue;
}
.contact .btn-blue {
position: relative;
margin-top: 30px;
color: white;
background: steelblue;
box-shadow: 0 8px #3b6d97;
}
.contact .btn-blue:hover {
background: #427aa9;
color: white;
}
.contact .btn-blue:after {
position: absolute;
content: '☃';
top: 5px;
right: 30px;
font-size: 1.6em;
}
.contact .btn-blue:active {
box-shadow: 0 4px #3b6d97;
-webkit-transform: translateY(4px);
-ms-transform: translateY(4px);
transform: translateY(4px);
}
.contact .creator a {
background: none;
}
/* MEDIA QUERIES STYLES
–––––––––––––––––––––––––––––––––––––––––––––––––– */
@media (min-width: 550px) {
nav li {
width: auto;
}
a {
box-shadow: 0 8px #f4ba04;
}
nav a {
padding: 7px;
border-right: 1px solid #fabd03;
width: 80px;
}
nav li:nth-child(2n+1) a:after {
content: none;
}
nav li:last-child a {
border-right: none;
}
header a:hover, .about a:hover {
box-shadow: 0 8px #f4ba04;
}
header a:active, .about a:active {
box-shadow: 0 4px #f4ba04;
-webkit-transform: translateY(4px);
-ms-transform: translateY(4px);
transform: translateY(4px);
}
.about .one-third {
margin-top: 0;
}
.about .one-third a {
width: 35%;
}
.contact .creator a {
box-shadow: none;
}
}
@media (min-width: 750px) {
h1 {
font-size: 3.5rem;
}
h3 {
font-size: 2.8rem;
}
h4 {
font-size: 2.4rem;
}
.services a:hover {
box-shadow: 0 -8px white;
-webkit-transform: scale(1.15);
-ms-transform: scale(1.15);
transform: scale(1.15);
}
.contact ul a {
margin-left: 45px;
}
.contact ul span {
font-size: 3em;
}
}
// Demo by George Martsoukos
// See: http://www.sitepoint.com/getting-started-with-skeleton-simple-css-boilerplate
Also see: Tab Triggers