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.
<script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>
<main id="main">
<!-- MAIN GRID LAYOUT -->
<div class="pageGrid">
<!-- TITLE BAR -->
<header id="title" class="cinzel-font text-center">
<h2>A Tribute To</h2>
<h1>Lewis Latimer</h1>
</header>
<!-- PHOTO AND INTRO SECTION -->
<section id="intro-section">
<div id="img-div">
<figure>
<!-- PHOTO -->
<img id="image" src="https://firebasestorage.googleapis.com/v0/b/online-coding.appspot.com/o/Lewis_Latimer_02.jpg?alt=media&token=cdf9f78a-6de8-4bce-8a61-4c650ad9ab3f" />
<!-- CAPTION -->
<figcaption id="img-caption" class="scopeOne-font text-center">
<small><em>(Painting of Lewis Latimer. Artist unknown.)</em></small>
</figcaption>
</figure>
</div>
<!-- INTRODUCTION -->
<article id="introArticle" class="text-center cinzel-font">
He was an inventor and draftsman best known for his contributions to the patenting of the light bulb and the telephone.
</article>
</section>
<section id="tribute-info">
<!-- MAIN BODY OF INFO -->
<article class="scopeOne-font">
<p>
Lewis Howard Latimer was born in Chelsea, Massachusetts, on September 4, 1848, to parents who had fled slavery. Latimer learned the art of mechanical drawing while working at a patent firm. Over the course of his career as a draftsman, Latimer worked closely with Thomas Edison and Alexander Graham Bell, in addition to designing his own inventions. He died in Flushing, Queens, New York, on December 11, 1928.
</p>
</article>
<!-- TIMELINE OF ACCOMPLISHMENTS -->
<article id="timeArticle">
<h2 class="cinzel-font text-center">
Timeline of Accomplishments
</h2>
<hr>
<ul class="scopeOne-font">
<li>
Light bulb with improved filament patented by Lewis Latimer, 1883 In 1874, he co-patented (with Charles W. Brown) an improved toilet system for railroad cars called the Water Closet for Railroad Cars (U.S. Patent 147,363).
</li>
<hr>
<li>
In 1876, Alexander Graham Bell employed Latimer, then a draftsman at Bell's patent law firm, to draft the necessary drawings required to receive a patent for Bell's telephone.
</li>
<hr>
<li>
In 1879, he moved to Bridgeport, Connecticut where he was hired as assistant manager and draftsman for the U.S. Electric Lighting Company, a company owned by Hiram Maxim, a rival of Thomas A. Edison.
</li>
<hr>
<li>
Latimer received a patent on January 17th 1882 for the "Process of Manufacturing Carbons", an improved method for the production of carbon filaments used in lightbulbs.
</li>
<hr>
<li>
The Edison Electric Light Company in New York City hired Latimer in 1884, as a draftsman and an expert witness in patent litigation on electric lights. Latimer is credited with an improved process for creating a carbon filament at this time, which was an improvement on Thomas Edison's original paper filament, which would burn out quickly. When that company was combined in 1892 with the Thomson-Houston Electric Company to form General Electric, he continued to work in the legal department. In 1911 he became a patent consultant to law firms.
</li>
</ul>
<!-- LINK TO EXTERNAL PAGE -->
<p class="link-frame scopeOne-font">
<a id="tribute-link" href="http://www.harvardsquarelibrary.org/biographies/lewis-howard-latimer/" target="_blank">Click here</a> if you'd like to learn more about Lewis Latimer.
</p>
</article>
</section>
</div>
</main>
*{ padding: 0; margin: 0; }
body{ font-size: var(--default-font-size); }
:root {
/*HEADER*/
--title-bottom-margin: 0;
/*TEXT*/
--default-font-size: 12pt;
--tribute-text-align: justify;
--intro-article-size: 1.1em;
--intro-article-align: center;
--timeArticle-text-align: center;
/*COLORS*/
--dark-brown: #513b33;
--burnt-orange: #a15227;
--tan: #b8865f;
/*INTRO GRID SETTINGS*/
--intro-grid-rows: auto;
--intro-grid-columns: 1fr;
--intro-grid-flow: rows;
/*PHOTO SETTINGS*/
--fig-size: 308px;
}
.cinzel-font{ font-family: 'Cinzel', serif; }
.scopeOne-font{ font-family: 'Scope One', serif; }
.text-center{ text-align: center; }
.pageGrid{
display: grid;
grid-template-columns: 1fr;
grid-auto-rows: minmax(auto, auto);
grid-auto-flow: rows;
background-color: var(--tan);
}
#title{
margin-bottom: var(--title-bottom-margin);
}
#title h2{ font-size: 1.2em; margin-top: 2em; color: var(--dark-brown); }
#title h1{ font-size: 2em; color: var(--dark-brown); }
#intro-section{
display: grid;
grid-template-columns: var(--intro-grid-columns);
grid-template-rows: var(--intro-grid-rows);
grid-auto-flow: var(--intro-grid-flow);
}
figure{ max-width: var(--fig-size); margin: auto; }
#image { max-width: 100%; display: block; height: auto; }
#img-caption{ font-size: 0.88em; color: var(--dark-brown); }
#introArticle{
align-self: center;
max-width: 666px;
color: var(--burnt-orange);
margin: 22px 6px;
text-align: var(--intro-article-align);
font-size: var(--intro-article-size); }
#tribute-info p{
padding: 0 8px;
margin-top: 4em;
color: var(--dark-brown);
font-size: .88em;
text-align: var(--tribute-text-align);
}
#tribute-info article{max-width: 777px; margin: 3em auto; }
#timeArticle{
max-width: 666px;
margin: 3em auto;
}
#timeArticle h2{ font-size: 1.2em; color: var(--dark-brown); }
#timeArticle ul { font-size: 0.88em; }
#timeArticle ul li{
padding: 0 8px;
color: var(--burnt-orange);
text-align: var(--timeArticle-text-align);
list-style: none;
}
hr{
display: block;
padding: 0;
margin: 2em auto;
width: 77%;
max-height: 0;
clear: both;
border: 0.5px solid #513b33;
}
.link-frame{
margin: 5em 0 9em 0;
color: var(--dark-brown);
}
@media screen and (min-width: 700px){
:root{
/*HEADER*/
--title-bottom-margin: 3em;
/*INTRO GRID SETTINGS*/
--intro-grid-rows: 1fr;
--intro-grid-columns: 30% 1fr;
--intro-grid-flow: columns;
--intro-article-size: 1.3em;
--intro-article-align: left;
--default-font-size: 16pt;
--timeArticle-text-align: left;
}
}
Also see: Tab Triggers