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 Skypack, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ES6 import
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.
<!DOCTYPE html>
<head>
<!-- To God our Savior, Who alone is wise, Be glory and majesty, Dominion and power, Both now and forever. Amen. Jude 1:25 -->
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>CODEPEN</title>
<!-- STYLESHEETS -->
<link href="https://fonts.googleapis.com/css?family=Oxygen:400,700" rel="stylesheet" type="text/css" />
<!-- EMBEDDED STYLES -->
<style type="text/css">
* { /* universal settings - all */
-webkit-box-sizing: border-box; /* vendor-prefix; webkit box-sizing */
-moz-box-sizing: border-box; /* vendor-prefix; mozilla box-sizing */
box-sizing: border-box; /* margin-sizing inclusions */
margin: 0; /* retract all default margin settings to set our own */
padding: 0; /* retract all default padding settings - for menus */
}
/* =Typograpy (mini mode) and built-ins for inherits
------------------------------------------------------ */
body { /* document body properties */
background-color: #343837; /* BODY BACKGROUND COLOR */
font-family: "Oxygen", sans-serif; /* font used for site */
font-size: 100%; /* base font size for viewport */
line-height: 1.4; /* base line height */
margin:0; /* get rid of wrapping containing body margin */
text-align:center;
}
h1 { /* h1 element attributes */
margin-bottom: 5px; /* set margin bottom */
}
h2 { /* h2 element attributes */
margin-bottom: 5px; /* set margin bottom */
}
h3 { /* h3 element attributes */
margin-bottom: 5px; /* set margin bottom */
}
p { /* paragraph element attributes */
margin-bottom: 5px; /* set margin bottom */
}
a { /* anchor tag element attributes */
color:#0084b4; /* set color of text */
}
</style>
</head>
<body>
<div id="page">
<header>
<div id="page-head">
<div id="title"><h2 id="site-description">"Let us rise up and build" 2:18</h2></div><!-- title -->
</div><!-- page-head -->
</header>
<nav id="access" role="navigation">
<div>
<ul class="menu">
<li><a href="index.html">Homepage</a>
<ul>
<li><a href="#">Example Link</a></li>
<li><a href="#">Example Link</a></li>
<li><a href="#">Example Link</a></li>
<li><a href="#">Example Link</a></li>
<li><a href="#">Example Link</a></li>
</ul>
</li>
<li><a href="#">Menu Item 2</a>
<ul>
<li><a href="#">Example Link</a></li>
<li><a href="#">Example Link</a></li>
<li><a href="#">Example Link</a></li>
<li><a href="#">Example Link</a></li>
<li><a href="#">Example Link</a></li>
</ul>
</li>
<li><a href="#">Menu Item 3</a>
<ul>
<li><a href="#">Example Link</a></li>
<li><a href="#">Example Link</a></li>
<li><a href="#">Example Link</a></li>
</ul>
</li>
<li><a href="#">Menu Item 4</a>
<ul>
<li><a href="#">Example Link</a></li>
<li><a href="#">Example Link</a></li>
<li><a href="#">Example Link</a></li>
<li><a href="#">Example Link</a></li>
</ul>
</li>
<li><a href="#">Menu Item 5</a>
<ul>
<li><a href="#">Example Link</a></li>
<li><a href="#">Example Link</a></li>
</ul>
</li>
<li><a href="#">Menu Item 6</a>
<ul>
<li><a href="#">Example Link</a></li>
<li><a href="#">Example Link</a></li>
<li><a href="#">Example Link</a></li>
<li><a href="#">Example Link</a></li>
<li><a href="#">Example Link</a></li>
<li><a href="#">Example Link</a></li>
<li><a href="#">Example Link</a></li>
</ul>
</li>
</ul>
</div>
</nav>
<div style="float:left;clear:both;padding: 1em;text-align:justify; font-size:75%;background-color:white;"><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta. Mauris massa. Vestibulum lacinia arcu eget nulla. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Curabitur sodales ligula in libero.</p></div>
<footer style="background-color:#ccc;border-radius:1em;margin:1em;font-size:75%;float:left;padding:1em;text-align:center;">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta. Mauris massa. Vestibulum lacinia arcu eget nulla. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Curabitur sodales ligula in libero.</footer>
</div><!-- page -->
</body>
</html>
@charset "utf-8";
/* CSS Document */
/* =Header (mini mode) and built-ins for inherits
---------------------------------------------------- */
#site-description { /* determine exact position of title in minimum screen layout (mini-mode) */
font-size: 1em; /* title font size */
padding-top: 60px; /* height from top of page */
font-weight: 800; /* this changes after sizing */
color: #fff; /* color of title text */
padding-bottom:.5em;
}
/* =Body Classes (mini mode)
------------------------------------------------------ */
#page {
width:320px;
position:relative;
margin:0 auto;
}
#page-head { /* page container for header */
background-color:#343837; /* background color */
overflow:hidden;
position: relative;
}
/* =Menu (mini mode)
------------------------------------------------------ */
#access {
width:100%;
left:0;
right:0;
margin-left:0;
margin-right:0;
display:block;
}
#access ul { /* accordion lists */
list-style:none; /* remove bullets */
margin: 0 auto; /* center and margin */
display: block; /* display type block */
width:100%; /* stretch to full width of container */
overflow:hidden; /* prevent margin wisk */
}
#access ul li { /* accordion list items */
background-color: #2C8DB7; /* BACKGROUND COLOR */
color: #FFF; /* LIST ITEM TEXT COLOR */
position: relative; /* set position relative for accordion menu items */
float: left; /* float items left */
width: 100%; /* set to width of container */
border-bottom-width: 1px; /* add a slight border to bottom of menus */
border-bottom-style: solid; /* solid line */
border-bottom-color: #CCC; /* color of border */
}
#access ul li a { /* accordion list item links */
color: #FFF; /* LINK TEXT COLOR */
display:block; /* display type block */
padding: 16px; /* add padding all around */
font-weight: 600; /* increase font weight */
text-decoration:none; /* get rid of underline */
}
#access li > ul { /* accordion menu items */
display:block; /* display menu items on hover */
height: 0; /* initially hide menu items */
-webkit-transition: all 500ms cubic-bezier(0.250, 0.100, 0.250, 1.000);
-moz-transition: all 500ms cubic-bezier(0.250, 0.100, 0.250, 1.000);
-ms-transition: all 500ms cubic-bezier(0.250, 0.100, 0.250, 1.000);
-o-transition: all 500ms cubic-bezier(0.250, 0.100, 0.250, 1.000);
transition: all 500ms cubic-bezier(0.250, 0.100, 0.250, 1.000); /* ease (default) */
background-color:#2C8DB7; /* default background of old default viewport - #A0A0A0 */
}
#access li:hover > ul { /* accordion menu items - on hover */
height:47px; /* set initial height of accordion opening */
overflow:visible; /* show overflow beyond set height */
}
#access li ul > li a { /* accordion menu item links */
background-color:#FEFEFE; /* MENU ITEM LINK BACKGROUND COLOR */
color:#000; /* MENU ITEM LINK TEXT COLOR */
font-weight:400; /* reset normal font weight */
padding: 12px; /* repad menu item links */
}
#access li ul > li:nth-of-type(odd) a { /* accordion menu item links (odd) */
background-color:#DDF; /* MENU ITEM LINK BACKGROUND COLOR - ODD */
}
#access li ul > li a:hover { /* accordion menu item links - on hover */
background-color:#fc0; /* MENU ITEM LINK BACKGROUND COLOR - ON HOVER */
color:#000; /* MENU ITEM LINK TEXT COLOR - ON HOVER */
font-weight:600; /* increase font weight */
}
Also see: Tab Triggers