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.
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bulletproof Test</title>
<meta charset="utf-8" />
<link rel="stylesheet" type="text/css" href="bulletproof.css">
</head>
<body>
<div id="wrapper">
<header>
<figure>
<img src="/Users/MRG/NU Classes/Interactive Producing/Interactive Midterm/midtermPages1/head2.jpg">
</figure>
<nav>
<ul>
<li>Home</li>
<li><a href="http://techniques.matthewrgelfand.com/midterm/about.html" alt="About Me" title="About Me">About</a></li>
<li>Story</li>
</ul>
</nav>
</header>
<div id="content">
<article class="post">
<h2>Are you depressed? The answer may lie in your blood</h2>
<figure>
<img class="armblood" src="/Users/MRG/NU Classes/Interactive Producing/Interactive Midterm/midtermPages1/armblood.jpg"/>
</figure>
<p>One year after identifying blood markers to determine depression symptoms in teenagers, new findings from a Northwestern University professor may be able to produce similar results in adults <a href="file:///Users/MRG/Desktop/Interactive%20Midterm/midtermstory1.html" target="_blank"> Click Here to Read More...</a></p>
</article>
<article class="post1">
<h2>The nose may hold answer to schizophrenia diagnosis</h2>
<figure>
<img class="nose" src="/Users/MRG/NU Classes/Interactive Producing/Interactive Midterm/midtermPages1/nose.jpg"/>
</figure>
<p>A new, non-invasive method to determine symptoms of schizophrenia may result in earlier detection of the disorder, according to research by doctors at Tel Aviv University’s Sackler Faculty of Medicine.</p>
</article>
<article class="post2">
<h2>Scientology Front Group Holds Anti-Psychiatry Exhibit</h2>
<figure>
<img class="psy_death" src="/Users/MRG/NU Classes/Interactive Producing/Interactive Midterm/midtermPages1/psy_death.jpg"/>
</figure>
<p>The Citizen's Commission on Human Rights, a Scientology front group formed in 1969, recently held an exihibit in Wicker Park aimed to portray the psychiatric community in a negative light.</p>
</article>
</div><!--end content-->
<aside>
<article class="box">
<h1>About Me</h1>
<img class="headshot" src="/Users/MRG/NU Classes/Interactive Producing/Interactive Midterm/midtermPages1/headshot2.jpg" />
<p>Matthew Gelfand is a 27-year-old graduate journalism student at Northwestern University's Medill School of Journalism. He is currently in his second quarter and is enrolled in the school's interactive track. He covers mental health and pharmacology for Northwestern's Medill News Service. <a href="www.espn.com" "alt="Bio Link">Click here for full bio</a></p>
</article>
<article class="box">
<h1>Social Media</h1>
<ul>
<li>Facebook</li>
<li>Twitter</li>
<li>LinkedIn</li>
<li>Google Plus</li>
</ul>
</article>
</aside>
<footer>
<div id="footer-content">
<div id="footer-nav">
<ul>
<li>thing one</li>
<li>thing one</li>
<li>thing one</li>
<li>thing one</li>
</ul>
<ul>
<li>thing one</li>
<li>thing one</li>
<li>thing one</li>
<li>thing one</li>
</ul>
<ul>
<li>thing one</li>
<li>thing one</li>
<li>thing one</li>
<li>thing one</li>
</ul>
</div><!--end footer-nav-->
</div><!--end footer content-->
</footer>
</div><!--End Wrapper-->
</body>
</html>
* {
margin: 0 auto;
}
body {
margin: 0;
padding: 0;
font-family: Verdana;
font-size: small;
background: #fafafa;
}
#wrapper {
max-width: 980px;
min-height: 100%;
background: white;
}
#content {
float: left;
width: 65%;
margin: 0 5% 0 1%;
line-height: 1.5em;
background: white;
}
header {
background: white;
}
nav {
background: white;
padding: 0 0 2% 0;
font-size: 90%;
text-align: center;
}
nav ul {
border-top: 1px solid #595a5c;
border-bottom: 1px solid #595a5c;
padding: 2%;
width: 95%;
list-style: none;
}
nav li {
padding: 5%;
color: #202020;
display: inline;
text-transform: uppercase;
}
nav a {
text-decoration: none;
}
nav a:hover {
color: orange; /*makes the nav bar text white on hover*/
}
.box a:hover {
color:#ffffff; /*makes the nav bar text white on hover*/
}
aside {
float: left;
width: 28%;
}
.box {
background: #111111;
background: rgba(0, 0, 0, 0.1);
color: black;
padding: 0 0 5% 5%;
margin-bottom: 17.5%;
font-size: 95%;
line-height: 1.5em;
border-top-left-radius: 10%;
border-bottom-right-radius: 10%;
border: 1px solid #595a5c;
}
.box h1 {
margin: 0;
padding: 5% 0 5% 0;
font-size: 250%;
font-weight: normal;
text-transform: uppercase;
border-bottom: 1px solid black;
}
.box ul {
margin-bottom: 5%;
padding-top: 5%;
padding-bottom: 15%;
margin-right: 4%;
}
.box li {
list-style: none;
padding: 5% 0 2% 0;
text-align: left;
font-size: 150%;
}
.box p{
padding-right: 5%;
}
#footer-nav ul {
width: 25%;
text-align: right;
margin: 7%;
}
#footer-nav li {
list-style: none;
text-transform: uppercase;
color: #adadad;
display: inline;
}
.post {
margin: 0 0 2% 0;
padding: 0 0 0 0;
display: block;
width: 100%;
float: right;
border-bottom: 1px solid #595a5c;
border-right: 1px solid #595a5c;
}
.post1 {
margin: 0 0 2% 0;
padding: 0 0 0 0;
display: block;
width: 100%;
float: right;
border-bottom: 1px solid #595a5c;
border-right: 1px solid #595a5c;
}
.post2 {
margin: 0 0 2% 0;
padding: 0 0 0 0;
display: block;
width: 100%;
float: right;
border-bottom: 1px solid #595a5c;
border-right: 1px solid #595a5c;
}
.post p {
width: 50%;
float: right;
padding: 0 5% 5% 0;
margin: 0;
color: #202020;
}
.post1 p {
width: 50%;
float: right;
padding: 0 5% 5% 0;
margin: 0;
color: #202020;
}
.post2 p {
width: 50%;
float: right;
padding: 0 5% 5% 0;
margin: 0;
color: #202020;
}
.nose {
width: 37%;
height: auto;
overflow: hidden;
float: left;
margin: 5% 0 0 2%;
padding: 0 0 0 0;
border: 1px solid #595a5c;
}
.armblood {
width: 37%;
height: auto;
overflow: hidden;
float: left;
margin: 5% 0 0 2%;
padding: 0 0 0 0;
border: 1px solid #595a5c;
}
.psy_death {
width: 37%;
height: auto;
overflow: hidden;
float: left;
margin: 5% 0 0 2%;
padding: 0 0 0 0;
border: 1px solid #595a5c;
}
.headshot {
width: 65%;
border: 1px solid #595a5c;
clear: both;
margin: 5% 5% 5% 0;
}
h2 {
width: 50%;
float: right;
padding: 5%;
}
footer {
clear: both;
}
#footer-content {
padding-bottom: 25%;
width: 100%;
background: #111111;
}
#footer-nav {
width: 85%;
float: left;
display: inline;
margin: 5% 0 0 7%;
padding: 5% 0 5% 0;
border-top: 1px solid #595a5c;
border-bottom: 1px solid #595a5c;
}
footer #footer-content #footer-nav ul {
padding-left: 0;
margin-top: 0;
margin-bottom: 0;
width: 23.72881%;
margin-left: 1.69492%;
float: left;
}
/* CSS for bulletproof-story */
.story {
width: 95%;
float: left;
padding-left: 5%;
}
Also see: Tab Triggers