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.
<html>
<head>
<meta charset="utf-8">
<title>Matt Phew | Designer</title>
<link rel="stylesheet" href="css/normalize.css">
<!-- Google Fonts Go Here -->
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<div class="wrapper">
<header>
<h1>Welcome To My Site</h1>
<nav class="nav">
<ul>
<li><a href="index.html">Home Page</a></li>
<li><a href="about.html">About Us</a></li>
<li><a href="contact.html">Contact Us</a></li>
</ul>
</nav>
</header>
<div class="main-content">
<h3>Welcome</h3>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Hoc non est positum in nostra actione. Sin est etiam corpus, ista explanatio naturae nempe hoc effecerit, ut ea, quae <img src="img/power.jpg" alt="" class="power">ante explanationem tenebamus, relinquamus. Quae enim adhuc protulisti, popularia sunt, ego autem a te elegantiora desidero. Et tamen quid attinet luxuriosis ullam exceptionem dari aut fingere aliquos, qui, cum luxuriose viverent, a summo philosopho non reprehenderentur eo nomine dumtaxat, cetera caverent? Nihilne te delectat umquam -video, quicum loquar-, te igitur, Torquate, ipsum per se nihil delectat? Qualis est igitur omnis haec, quam dico, conspiratio consensusque virtutum, tale est illud ipsum honestum, quandoquidem honestum aut ipsa virtus est aut res gesta virtute; Duo Reges: constructio interrete. Nam haec ipsa mihi erunt in promptu, quae modo audivi, nec ante aggrediar, quam te ab istis, quos dicis, instructum videro. Placet igitur tibi, Cato, cum res sumpseris non concessas, ex illis efficere, quod velis? Idque quo magis quidam ita faciunt, ut iure etiam reprehendantur, hoc magis intellegendum est haec ipsa nimia in quibusdam futura non fuisse, nisi quaedam essent modica natura.
</p>
<p>
Deque his rebus satis multa in nostris de re publica libris sunt dicta a Laelio. Audi, ne longe abeam, moriens quid dicat Epicurus, ut intellegas facta eius cum dictis discrepare: Epicurus Hermarcho salutem. Quoniam igitur, ut medicina valitudinis, navigationis gubernatio, sic vivendi ars est prudente, necesse est eam quoque ab aliqua re esse constitutam et profectam. Aufidio, praetorio, erudito homine, oculis capto, saepe audiebam, cum se lucis magis quam utilitatis desiderio moveri diceret. An haec ab eo non <img src="img/laptop.jpg" alt="" class="lap-top">dicuntur? Nobis enim ista quaesita, a nobis descripta, notata, praecepta sunt, omniumque rerum publicarum reetionis genera, status, mutationes, leges etiam et instituta ac mores civitatum perscripsimus. Quin etiam ferae, inquit Pacuvius, quíbus abest, ad praécavendum intéllegendi astútia, iniecto terrore mortis horrescunt. Sed emolumenta communia esse dicuntur, recte autem facta et peccata non habentur communia. De bona autem fama-quam enim appellant eÈdoj¤an, aptius est bonam famam hoc loco appellare quam gloriam-Chrysippus quidem et Diogenes detracta utilitate ne digitum quidem eius causa porrigendum esse dicebant; Qui enim existimabit posse se miserum esse beatus non erit.
</p>
</div>
<footer class="footer">
<p>© Crazy and Web Designs 2014.</p>
</footer>
</div>
</body>
</html>
/**********************************
Setting the border box rule
**********************************/
*, *:before, *:after {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
/**********************************
Centering the web page
**********************************/
.wrapper {
max-width: 960px;
margin: 0 auto;
}
/*********************************
Removing the white-space from the
very top of the browser view
port. Adding some style to the
header.
*********************************/
header {
background: #ff0000;
color: #fff;
text-align: center;
float: left;
margin: 0 0 30px 0;
padding: 5px 0 0 0;
width: 100%;
}
body {
margin: 0;
}
/************************
Adding a little more
height to the h1 heading
************************/
h1 {
height: 75px;
}
/****************************
Adjusting the and styling the
nav.
****************************/
.nav {
background: #bf3030;
font-size: 1.2em;
margin: 0;
padding: 0;
text-align: center;
}
.nav li {
display: inline;
}
.nav ul {
margin: 0;
}
.nav a {
display: inline-block;
padding: 10px;
text-decoration: none;
}
/**************************
Styling the nav pseudo
classes.
**************************/
.nav a:link {
color: #ff0000;
}
.nav a:visited {
color: #FFA07A;
}
.nav a:hover {
color: #fff;
}
.nav a:active {
color: #CD5C5C;
}
/***************************
Styling the background,
adding padding.
***************************/
.main-content {
background: #a60000;
color: #fff;
padding: 15px;
}
.main-content p {
overflow: auto;
}
/***************************
Styling and centering the
h3 heading.
**************************/
h3 {
color: #ff7373;
text-align: center;
}
/*******************
Styling the images
********************/
.power {
float: right;
max-width: 100%;
width: 13.6%;
margin: 2.5%;
}
.lap-top {
float: left;
max-width: 100%;
width: 18.6%;
margin: 2.5%;
}
.connector {
float: right;
width: 40%;
margin: 1.5%;
max-width: 100%;
}
.cat {
float: left;
width: 35%;
margin: 2%;
max-width: 100%;
}
/**************************
Styling the footer and also
removing the white-space
between the .main-content
and footer.
**************************/
.footer {
background: #ff4040;
color: #fff;
font-size: 2em;
min-height: 80px;
text-align: center;
}
.footer p:first-child {
margin: 0;
}
Also see: Tab Triggers