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.
Private Pens are hidden everywhere on CodePen, except to you. You can still share them and other people can see them, they just can't find them through searching or browsing.
Upgrade to PROIf 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.
Templates are Pens that can be used to start other Pens quickly from the create menu. The new Pen will copy all the code and settings from the template and make a new Pen (that is not a fork). You can view all of your templates, or learn more in the documentation.
Any Pen can act as a template (even if you don't flip the toggle above) with a special URL you can use yourself or share with others. Here's this Pen's template URL:
Screenshots of Pens are shown in mobile browsers, RSS feeds, to users who chose images instead of iframes, and in social media sharing.
This Pen is using the default Screenshot, generated by CodePen. Upgrade to PRO to upload your own thumbnail that will be displayed on previews of this pen throughout the site and when sharing to social media.
Upgrade to PRO
<!DOCTYPE html>
<html lang=en>
<head>
<meta charset=utf-8>
<title>Torvgården</title>
<link rel="stylesheet" href="css/reset.css">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<div id="main-wrapper">
<div id="content">
<header id="main-header">
<img src="images/banner-head.jpg" alt="main-header">
</header><!-- END #main-header -->
<nav id="main-navigation">
<ul>
<li><a href="#">Hjem</a></li>
<li><a href="#">Butikker</a></li>
<li><a href="#">Kampanjer</a></li>
<li><a href="#">Åpningstider</a></li>
<li><a href="#">Om torvgården</a></li>
</ul>
</nav><!-- END #main-navigation -->
<div id="main-content">
<p>Content comes here!</p>
<p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?</p>
<p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?</p>
<p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?</p>
<p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?</p>
<p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?</p>
<p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?</p>
</div><!-- END #main-content -->
</div><!-- END #content -->
<div id="sidebar-wrapper">
<aside id="sidebar">
<section class="sidebar-info">
<h1>Åpningstider</h1>
<p>Mandag - fredag kl. 09-18</p>
<p>Lørdag kl. 10-18</p>
</section><!-- END .sidebar-info -->
<section class="sidebar-info">
<h1>Kontaktinfo</h1>
<p>Torvgården</p>
<p>Øvre langgate 57-59</p>
<p>3110 Tønsberg</p>
<br>
<p>Telefon: 33 33 23 23</p>
<p>E-post: <a href="mailto:post@torvgaarden.no">post@torvgaarden.no</a></p>
</section><!-- END .sidebar-info -->
<section class="sidebar-info-2">
<h1>Butikker</h1>
<a class="aside-link" href="#">Neoz</a>
<a class="aside-link" href="#">Boutique L</a>
<a class="aside-link" href="#">Friis Company</a>
<a class="aside-link" href="#">B.Young</a>
<a class="aside-link" href="#">Kiesler hårdesign</a>
<a class="aside-link" href="#">Spenst</a>
<a class="aside-link" href="#">Parfymeri Clinic Ethic</a>
<a class="aside-link" href="#">Cacao sko</a>
</section><!-- END .sidebar-info-2 -->
<section class="sidebar-info">
<h1>Om torvgården</h1>
<p>Et besøk i Torvgården i sentrum av Tønsberg skal gi deg som kunde, en god totalopplevelse i delikate omgivelser. Torvgården er stedet du går når du skal unne deg det lille ekstra.</p>
<a class="more-info" href="#">Mer info...</a>
</section><!-- END .sidebar-info -->
</aside><!-- END #sidebar -->
</div><!-- END #sidebar-wrapper -->
<br style="clear: both;" />
</div><!-- END #main-wrapper -->
<footer id="main-footer">
<div id="footer-wrapper">
<section id="footer-copyright">
<p>Digitalfabrikken (c) 2013 | Torvgården (c) 2013</p>
<p>It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now</p>
</section><!-- END #footer-copyright -->
<section class="footer-info">
<h3>Butikker</h3>
<a class="aside-link" href="#">Neoz</a>
<a class="aside-link" href="#">Boutique L</a>
<a class="aside-link" href="#">Friis Company</a>
<a class="aside-link" href="#">B.Young</a>
<a class="aside-link" href="#">Kiesler hårdesign</a>
<a class="aside-link" href="#">Spenst</a>
<a class="aside-link" href="#">Parfymeri Clinic Ethic</a>
<a class="aside-link" href="#">Cacao sko</a>
</section><!-- END .footer-info -->
<section class="footer-info">
<h3>Kampanjer</h3>
<a class="aside-link" href="#">Høstkampanje</a>
<a class="aside-link" href="#">Valentines 2013</a>
<a class="aside-link" href="#">Bli ny</a>
</section><!-- END .footer-info -->
<section class="footer-info">
<h3>Åpningstider</h3>
<a class="aside-link" href="#">Høstkampanje</a>
</section><!-- END .footer-info -->
<section class="footer-info">
<h3>Om torvgården</h3>
<a class="aside-link" href="#">Høstkampanje</a>
<a class="aside-link" href="#">Valentines 2013</a>
<a class="aside-link" href="#">Bli ny</a>
</section><!-- END .footer-info -->
</div><!-- END #footer-wrapper -->
</footer><!-- END #main-footer -->
</body>
</html>
/* RESET */
/**
* YUI 3.5.0 - reset.css (http://developer.yahoo.com/yui/3/cssreset/)
* http://cssreset.com
* Copyright 2012 Yahoo! Inc. All rights reserved.
* http://yuilibrary.com/license/
*/
/*
TODO will need to remove settings on HTML since we can't namespace it.
TODO with the prefix, should I group by selector or property for weight savings?
*/
html{
color:#000;
background:#FFF;
}
/*
TODO remove settings on BODY since we can't namespace it.
*/
/*
TODO test putting a class on HEAD.
- Fails on FF.
*/
body,
div,
dl,
dt,
dd,
ul,
ol,
li,
h1,
h2,
h3,
h4,
h5,
h6,
pre,
code,
form,
fieldset,
legend,
input,
textarea,
p,
blockquote,
th,
td {
margin:0;
padding:0;
}
table {
border-collapse:collapse;
border-spacing:0;
}
fieldset,
img {
border:0;
}
/*
TODO think about hanlding inheritence differently, maybe letting IE6 fail a bit...
*/
address,
caption,
cite,
code,
dfn,
em,
strong,
th,
var {
font-style:normal;
font-weight:normal;
}
ol,
ul {
list-style:none;
}
a {
text-decoration: none;
}
caption,
th {
text-align:left;
}
h1,
h2,
h3,
h4,
h5,
h6 {
font-size:100%;
font-weight:normal;
}
q:before,
q:after {
content:'';
}
abbr,
acronym {
border:0;
font-variant:normal;
}
/* to preserve line-height and selector appearance */
sup {
vertical-align:text-top;
}
sub {
vertical-align:text-bottom;
}
input,
textarea,
select {
font-family:inherit;
font-size:inherit;
font-weight:inherit;
}
/*to enable resizing for IE*/
input,
textarea,
select {
*font-size:100%;
}
/*because legend doesn't inherit in IE */
legend {
color:#000;
}
/* YUI CSS Detection Stamp */
#yui3-css-stamp.cssreset { display: none; }
/* MAIN CSS */
/* FONTS */
@font-face {
font-family: 'pill_gothicbold';
src: url('font/pillgothic-bold-webfont.eot');
src: url('font/pillgothic-bold-webfont.eot?#iefix') format('embedded-opentype'),
url('font/pillgothic-bold-webfont.woff') format('woff'),
url('font/pillgothic-bold-webfont.ttf') format('truetype'),
url('font/pillgothic-bold-webfont.svg#pill_gothicbold') format('svg');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'pill_gothicnormal';
src: url('font/pillgothic-normal-webfont.eot');
src: url('font/pillgothic-normal-webfont.eot?#iefix') format('embedded-opentype'),
url('font/pillgothic-normal-webfont.woff') format('woff'),
url('font/pillgothic-normal-webfont.ttf') format('truetype'),
url('font/pillgothic-normal-webfont.svg#pill_gothicnormal') format('svg');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'pill_gothicsemibd';
src: url('font/pillgothic-semibd-webfont.eot');
src: url('font/pillgothic-semibd-webfont.eot?#iefix') format('embedded-opentype'),
url('font/pillgothic-semibd-webfont.woff') format('woff'),
url('font/pillgothic-semibd-webfont.ttf') format('truetype'),
url('font/pillgothic-semibd-webfont.svg#pill_gothicsemibd') format('svg');
font-weight: normal;
font-style: normal;
}
/* HEADER AND BG */
html {
background-color: #f2fbf9;
}
body {
margin: 25px 0 0 0;
}
#main-header {
padding: 5px 0;
border-top: 1px solid black;
border-bottom: 3px solid black;
}
#main-header img {
width: 940px;
height: 382px;
margin: 0 auto;
}
#main-wrapper {
width: 980px;
margin: 0 auto;
background-color: #fdfefe;
-moz-box-shadow: 0 0 7px 0px rgba(0,0,0,0.07);
-webkit-box-shadow: 0 0 7px 0px rgba(0,0,0,0.07);
box-shadow: 0 0 7px 0px rgba(0,0,0,0.07);
}
#content {
margin: 0 20px;
padding: 22px 0 0 0;
}
/* FONTS, STANDARDS */
h1, h2, h3, h4, h5, p, a, li {
font-family: "Pill Gothic", Verdana, sans-serif;
}
h1 {
font-size: 1.0em;
text-transform: uppercase;
}
h3 {
font-size: 0.813em;
font-weight: bold;
}
a {
text-decoration: none;
}
/* NAVIGATION */
#main-navigation {
height: 54px;
overflow: hidden;
width: 670px;
border-bottom: 1px solid black;
}
#main-navigation ul {
height: 54px;
overflow: hidden;
display: table;
width: 100%;
}
#main-navigation li {
font-size: 1.0em;
text-transform: uppercase;
list-style: none;
display: table-cell;
}
#main-navigation li a {
color: #000000;
display: block;
padding: 20px;
white-space: nowrap;
text-align: center;
}
#main-navigation li a:hover {
background-color: #f7f7f7;
}
#main-navigation li a:active {
background-color: #f7f7f7;
}
/* CONTENT */
#main-content {
width: 655px;
float: left;
padding: 25px 0;
}
/* SIDEBAR */
#sidebar {
width: 270px;
float: right;
position: relative;
margin: -120px 20px 0 0;
background-color: #282828;
padding: 0 0 25px 0;
}
.sidebar-info, .sidebar-info-2 {
padding: 25px 0 0 0;
}
.sidebar-info p {
font-size: 0.750em;
padding: 0 25px;
line-height: 16pt;
color: #fdfefe;
}
.sidebar-info a {
font-size: 0.750em;
line-height: 16pt;
color: #fdfefe;
}
.sidebar-info h1 {
font-weight: normal;
padding: 0 25px 10px 25px;
color: #ffffff;
}
.sidebar-info-2 h1 {
padding: 0 25px 15px 25px;
color: #ffffff;
}
.sidebar-info p a {
font-size: 1em;
}
.sidebar-info-2 a {
font-size: 0.750em;
color: #ffffff;
display: block;
width: 100%;
padding: 0 25px;
line-height: 16pt;
text-transform: uppercase;
-webkit-transition-property: color, padding;
-moz-transition: color, padding;
-o-transition: color, padding;
transition: color, padding;
-webkit-transition-duration: 0.1s, 0.1s;
-moz-transition: 0.1s, 0.1s;
-o-transition: 0.1s, 0.1s;
transition: 0.1s, 0.1s;
-webkit-transition-timing-function: linear, ease-in;
-moz-transition: linear, ease-in;
-o-transition: linear, ease-in;
transition: linear, ease-in;
}
.sidebar-info-2 a:hover {
padding: 0 25px 0 28px;
color: #dddddd;
}
.more-info a {
font-size: 0.750em;
}
.more-info {
font-size: 0.750em;
color: #ffffff;
padding: 0px 25px;
line-height: 16pt;
text-transform: uppercase;
-webkit-transition-property: color;
-moz-transition: color;
-o-transition: color;
transition: color;
-webkit-transition-duration: 0.1s, 0.1s;
-moz-transition: 0.1s, 0.1s;
-o-transition: 0.1s, 0.1s;
transition: 0.1s, 0.1s;
-webkit-transition-timing-function: linear, ease-in;
-moz-transition: linear, ease-in;
-o-transition: linear, ease-in;
transition: linear, ease-in;
}
.more-info:hover {
color: #dddddd;
}
/* FOOTER */
footer {
background-color: #282828;
padding: 45px 0 0 0;
overflow: hidden;
width: 100%;
}
#footer-wrapper {
width: 980px;
margin: 0 auto;
}
#footer-copyright {
font-size: 0.625em;
padding: 0 20px 60px 20px;
line-height: 12pt;
color: #b6b6b6;
}
.footer-info {
width: 100px;
padding: 0 0 90px 20px;
line-height: 14pt;
margin: 0 50px 0 0;
color: #b6b6b6;
float: left;
}
.footer-info a {
font-size: 0.688em;
color: #b6b6b6;
display: block;
width: 100%;
}
.footer-info a {
-webkit-transition-property: color, padding;
-moz-transition: color, padding;
-o-transition: color, padding;
transition: color, padding;
-webkit-transition-duration: 0.1s, 0.1s;
-moz-transition: 0.1s, 0.1s;
-o-transition: 0.1s, 0.1s;
transition: 0.1s, 0.1s;
-webkit-transition-timing-function: linear, ease-in;
-moz-transition: linear, ease-in;
-o-transition: linear, ease-in;
transition: linear, ease-in;
}
.footer-info a:hover {
padding: 0 0 0 3px;
color: #818181;
}
Also see: Tab Triggers