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. You can use the CSS from another Pen by using it's URL and the proper URL extention.
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.
<main id="app"></main>
<footer>
<div class="copyright">© 2017 Peter Martinson</div>
<div class="github"><a href="https://github.com/peterjmartinson/chingu-fcc-speedrun-challenge/tree/master/frontend/tribute-page">FCC : Tribute 1.0</a></div>
<div class="license">MIT License</div>
</footer>
<script src="js/app.js"> </script>
/*
* Styling for fcc-tribute
*
* Author: Peter Martinson
*/
html {
font-size: 10px;
font-family: 'Lora',serif;
color: black;
background: #ffffff;
border: 0px;
margin: 0px;
padding: 0px;
}
body {
font-size: 2rem;
margin: auto;
max-width: 1000px;
}
main {
border: 0px solid black;
padding: 10px;
}
/*
* The first section is always the title splash
*/
main > section {
text-align: center;
}
main h1 {
font-weight: normal;
font-size: 4rem;
margin-bottom: 0px;
}
main h2 {
font-weight: normal;
}
section {
font-family: 'Raleway',serif;
border: 1px solid black;
margin: 10px;
padding: 10px;
box-shadow: 0px 0px 5px black;
}
section p, li {
text-align: justify;
}
figure {
width: 450px;
float: right;
border: 1px solid black;
font-size: 1.5rem;
font-style: italic;
padding: 10px;
margin: 10px;
}
figure img {
width: 430px;
}
footer {
font-family: sans-serif;
background: black;
color: white;
font-size: 1.5rem;
font-weight: normal;
padding-top: 10px;
padding-bottom: 10px;
width: 100%;
float: left;
}
footer div {
display: inline-block;
}
footer .copyright {
width: 32%;
text-align: left;
padding-left: 1%;
}
footer .github {
width: 33%;
text-align: center;
}
footer .license {
width: 32%;
text-align: right;
padding-right: 1%;
}
var output = '';
output += '<section>';
output += '<h1>Adolf Seilacher</h1>';
output += '<span>(March 15, 1925 - April 26, 2014)</span>';
output += '<h2>Linked the deep ocean with prehistoric life</h2>';
output += '</section>';
output += '<article>';
output += ' <section>';
output += ' <p>It is said that old warriors never die, they just fade away. In a similar way, old paleontologists simply enter geological time. Adolf Seilacher was one of the old guard of paleontology when he became part of the fossil record. In a time when young hotshot paleontologists can do a few fast Fourier transforms on vast databases of fossil data, and generate fantastical New York Times headlines, Seilacher <strong>worked</strong>. His breakthroughs were rarely the stuff of clickbait, but his work is now foundational in paleontology courses.</p>';
output += ' <figure>';
output += ' <img src="http://www.naturalhistorymag.com/htmlsite/0904/images/0904feature2.jpg" alt="Ancient fossil Paleodictyon">';
output += ' <figcaption>Fossilized paleodictyon from Paleozoic</figcaption>';
output += ' </figure>';
output += ' <p>Late in life, Seilacher announced his theory of the "Golden Ages". It is well known that the dinosaurs were done in by an incredible catastrophe, usually attributed to an asteroid or volcanic outbursts. That extinction was massive, but the Earth has seen many extinctions at a smaller scale. Seilacher observed that, leading up to extinctions, those species that ceased to exist had developed both strange morphologies and strange behaviors. For example, before going extinct, many species tend to grow gigantic. Or, they grow strange appendages, like the enormous antlers on the Irish Elk. In Seilacher\'s terms, a species <em>grows decadent</em>.</p>';
output += ' <p>Seilacher saw this phenomenon as a natural result of Darwinian natural selection. As organisms out compete each other, they tend to become ever more specialized in their niche. Their specializations are manifestations of what gives them an advantage over other competing creatures. Over time, organisms grow <em>overspecialized</em>. They become so finely tuned to their niche that even small changes in the environment can throw them off their game. If their environment changes quickly enough, their specializations could become burdens. Evolution would then favor less developed species, who don\'t have to first back out of previous specializations, before adapting to new conditions. In this way, decadent species become prime targets for extinction.</p>';
output += ' <p>Seilacher observed that there are periods when many species tend to grow decadent together. During these <strong>Golden Ages</strong>, the Earth\'s climate remained relatively constant, providing no real challenges to evolution. When catastrophe hit, however, all of these decadent lineages disappeared. Wiped out, by their own success. These are the mass extinction events. Seilacher claimed that, before every major extinction, there would exist a Golden Age.</p>';
output += ' <figure>';
output += ' <img src="http://www.naturalhistorymag.com/htmlsite/0904/images/0904feature_hexagon.jpg" alt="Modern Paleodictyon found on ocean floor">';
output += ' <figcaption>Modern paleodictyon found on bottom of the ocean, by Seilacher</figcaption>';
output += ' </figure>';
output += ' <p>Seilacher made two claims as a result of his theory, one which was proven true, and one which is now a major area of research.</p>';
output += ' <ol>';
output += ' <li>Overspecialization occurs in environments that are shielded from rapid change. One place on the Earth that fits this description happens to be the bottom of the ocean. The ocean floor does not experience a day/night cycle, does not feel the tides, and is unaffected by changes in climate. Seilacher declared that at the bottom of the ocean, we would find fantastical creatures, so overspecialized as to be unrecognizable. We might also find creatures long thought extinct, doing today exactly what their fossils showed them doing millions of years ago. He was right on both counts. Seilacher himself traveled down to the ocean floor once, and observed such a "living fossil", pictured to the right.</li>';
output += ' <li>Since mass extinctions usually followed extended terrestrial hothouse conditions, Seilacher suggested that "the ball needs to be tossed to the astronomers." What galactic phenomena drive climate cycles on the Earth? What causes prolonged hothouse conditions here? Is it perhaps changes in cosmic ray intensity, which itself is changed by both solar activity, and by our solar system\'s motion through the galaxy? How does the Earth\'s interaction with its intergalactic neighborhood impact the ability for creatures to become overspecialized?</li>';
output += ' </ol>';
output += ' <p>The concept of Golden Ages is only one of Seilacher\'s many contributions to not just paleontology, but to Man\'s understanding of his place in the universe. The rocks may now have his bones, but his ideas belong to us.</p>';
output += ' <p> For more, please see <a href="https://stonetelescope.wordpress.com/2015/02/03/life-before-extinction-seilachers-theory-of-the-golden-ages/">my research paper on Seilacher</a>.</p>';
output += ' </section>';
output += '</article>';
var tag = document.getElementById("app");
tag.innerHTML = output;
Also see: Tab Triggers