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 URL's added here will be added as <link>
s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.
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.
If the stylesheet 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 CSS 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.
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.
<script src="https://use.fontawesome.com/2dc41cc4d7.js"></script>
<body>
<div id="hmmm">
<section>
<nav class="navbar navbar-toggleable-md fixed-top nav navbar-inverse">
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<a class="navbar-brand">Elizabeth Jennings</a>
<div class="collapse navbar-collapse justify-content-end" id="navbarCollapse">
<ul class="navbar-nav">
<li class="nav-item nav-link"><a href="#About">About</a></li>
<li class="nav-item nav-link"><a href="#Portfolio">Portfolio</a></li>
<li class="nav-item nav-link"><a href="#Contact">Contact</a></li>
</ul>
</div>
</nav>
</section> <!-- Nav -->
<main>
<!-- About / Pic -->
<a class="anchor" name="About"></a>
<section class="about">
<ul>
<li><p class="lead" style="min-width:15em;">"The problem isn't that capitalism isn't working. It's that it's working exactly as intended. Be free from the fascists!"</p></li>
<hr>
<li style="text-align: center;"><p class="lead"><em>Soviet Spy — Badass — Travel Agent</em></p></li>
</ul>
<div class="img"><a name="About"><img src="http://vignette4.wikia.nocookie.net/theamericans/images/c/c3/Elizabeth_jennings.png" class="img-circle" style="min-width:15em;"></a></div>
</section>
<!-- Portfolio -->
<section class="portfolio">
<p class="lead">— Portfolio —</p><a class="anchor" name="Portfolio"></a>
<figure><img src="http://img.wennermedia.com/article-leads-horizontal/rs-18566-americans-1800-1393257583.jpg"><figcaption>This is me doing some espionage.</figcaption></figure>
<figure><img src="https://static01.nyt.com/images/2015/02/04/arts/04AMERICANSWEB/04AMERICANSWEB-tmagArticle.jpg"><figcaption>Who dis? It's me! Master of disguise.</figcaption></figure>
<figure><img src="https://i.dailymail.co.uk/i/pix/2014/11/21/235C55AD00000578-0-image-122_1416574806134.jpg"><figcaption>And how about this one? Me as well. Boom! Espionage, bitch!</figcaption></figure>
<figure><img src="http://cdn.idigitaltimes.com/sites/idigitaltimes.com/files/2014/08/28/2013/06/20/9393.jpg"><figcaption>And what about these pricks? Yeah. Government-issued husband, and the little brats we made.</figcaption></figure>
<figure><img src="http://blog.victimsofcommunism.org/wp-content/uploads/2015/05/jYQdyGu9tl75V2.jpg"><figcaption>I'm such a badass spy they even put my face on a poster.</figcaption></figure>
<figure><img src="http://si.wsj.net/public/resources/images/BN-OE401_alley_J_20160525130506.jpg"><figcaption>Communism sucks, you say? But it punches real hard, fascist!</figcaption></figure>
</section>
<!-- Contact -->
<a class="anchor" name="Contact"></a>
<section class="contact">
<p class="lead">— Contact —</p>
<form>
<p>to: Nadezhda (Elizabeth Jennings)</p>
<div id="from">
<input type="text" id="name" name="user_name" placeholder="from:">
</div>
<div id="reply">
<input type="email" id="mail" name="user_email" placeholder="reply to:">
</div>
<div id="message">
<textarea id="msg" name="user_message" placeholder="your secret message:"></textarea>
</div>
<div class="button">
<button type="submit">to the motherland!</button>
</div>
</form>
<div class="meh">
<p>I'm currently unavailable for espionage work. If you'd like to book your vacations please contact me though.</p><p>Beware I will sell your e-mail address to sleazy marketing companies, and you'll never see the end of the barrage of spam that will flood your mailbox. It's all in the name of communism though, so it's fine.</p>
</div>
</section>
<!-- BS -->
<section class="BS">
<div class="divabout">
<p class="lead">— About this page —</p>
<ul>
<li><p>Built for the freeCodeCamp personal portfolio project.</p></li>
<li><i class="fa fa-free-code-camp"></i></li>
<li><p>Using CSS and HTML (and Flexbox!)</li>
<li><i class="fa fa-css3"></i>
<i class="fa fa-html5"></i></li>
</ul>
</div>
<div class="divaround">
<p class="lead">— Around the web —</p>
<i class="fa fa-github"></i>
<i class="fa fa-linkedin-square"></i>
<i class="fa fa-twitter-square"></i>
</div>
</section>
</main>
<footer><div class="footerp"><p>Elizabeth Jennings ® 2017</p><p>Actually, there are no rights reserved whatsoever. For communism!</p> <i class="fa fa-code"></i></div></footer>
</div>
</body>
body{
display: flex;
flex-direction: column;
background-color: #fff;
//width: 100%;
text-align: center;
background-image: url(http://previews.123rf.com/images/hchjjl/hchjjl1506/hchjjl150607137/41316656-sickle-hammer-doodle-seamless-pattern-background-Stock-Vector.jpg);
background-repeat: repeat;
background-size: 20rem;
padding-top: 4em;
}
#hmmm {
max-width: 60rem;
text-align: left;
margin: 0 auto;
border: 1px solid black;
border-top: 0;
}
a.anchor {
display: block;
position: relative;
top: -4rem;
visibility: hidden;
}
.img-circle {
border-radius: 50%;
}
.nav {
//display: flex;
//flex-direction: row;
background-color: #700;
//align-items: center;
color: #fff;
}
.nav ul {
//flex: 1 1 0;
//list-style: none;
//display: flex;
//flex-direction: row;
//justify-content: flex-end;
//margin-bottom: 0;
}
.nav li {
padding: 0.25rem 1rem;
}
.navbar-brand {
flow: 1 1 0;
font-size: 2em;
font-variant: small-caps;
margin: 0;
padding: 0;
}
.nav a:link, .nav a:visited {
color: white;
}
.nav a:hover {
text-decoration: underline;
}
.nav a:active { }
.about {
display: flex;
flex-direction: row;
justify-content: space-around;
align-items: center;
padding: 1rem;
flex-wrap: wrap;
background-color: #ddd;
}
.about ul {
flex: 2 1 0;
padding: 0 2rem 0 1rem;
list-style-type: none;
}
.img {
flex: 1 1 0;
}
.img img {
width: 100%;
}
.portfolio {
background-color: #eee;
display: flex;
flex-flow: row wrap;
justify-content: space-around;
align-items: flex-start;
}
.portfolio .lead {
flex: 1 0 100%;
text-align: center;
font-size: 2em;
font-variant: small-caps;
}
.portfolio img {
width: 25rem;
border-radius: 0.5em;
}
.portfolio figure {
flex: 0 0 0;
padding: 0.25rem;
text-align: center;
background-color: #ddd;
border-radius: 0.5em;
}
.portfolio figcaption {
font-size: 0.8rem;
color: #666;
padding: 0.25rem;
}
.contact {
display: flex;
flex-flow: row wrap;
background-color: #ddd;
}
.contact input, .contact textarea, .contact select, .contact button {
width : 100%;
margin: 0;
}
.contact .lead {
flex: 1 0 100%;
text-align: center;
font-size: 2em;
font-variant: small-caps;
}
.contact form {
flex: 1 1 0;
padding: 2rem;
}
.contact .meh {
flex: 1 1 0;
padding: 2rem;
line-height: 2;
}
.contact input, .contact textarea, .contact button {
margin: 0.5em 0;
}
.contact form p {
margin: 0.25rem 0;
}
footer {
background-color: #700;
color: #ddd;
text-align: center;
}
footer .footerp {
padding: 0.5rem;
}
footer p {
margin: 0;
font-size: 0.8rem;
}
.BS {
background-color: #eee;
display: flex;
flex-flow: row wrap;
justify-content: space-around;
align-items: stretch;
}
i.fa {
font-size: 3em; /*font size for the icons*/
}
footer i.fa {
font-size: 1.25em; /*font size for the icons*/
}
.BS .lead {
text-align: center;
font-size: 1em;
font-variant: small-caps;
margin-top: 1em;
}
.divabout {
flex: 1 1 0;
display: flex;
flex-flow: column wrap;
align-items: center;
justify-content: flex-start;
text-align: center; }
.divabout p {
margin: 0; }
.divaround {
flex: 1 1 0;
display: flex;
flex-flow: column wrap;
align-items: center;
justify-content: flex-start; }
.divaround i {
margin: 0.5rem;
}
.BS ul {
list-style: none;
padding: 0; }
.BS li {
margin: 1em; }
Also see: Tab Triggers