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.
<body>
<section id="main">
<section id="top">
<h1 id="title">Thomas Edison</h1>
<p id="tag-line">America's greatest inventor</p>
</section>
<section id="img-div">
<img id="image" src="https://hakabuk.com/fcc/resources/tribute-page/thomas-edison-portrait.jpg">
<img id="light-bulb-off" src="https://hakabuk.com/fcc/resources/tribute-page/base-light-bulb-icon.png">
<img id="light-bulb-on" src="https://hakabuk.com/fcc/resources/tribute-page/light-bulb-icon.png">
<p id="img-caption" alt="Portrait of the Famous Inventor Thomas Edison. ">
Portrait of the Famous Inventor Thomas Edison.
<br>
Photo via <a href="https://www.goodfreephotos.com/">Good Free Photos</a>
</p>
</section>
<section id="tribute-info">
<div class="container">
<div id="general">
<h3>General Information</h3>
<p>
<b>Thomas Alva Edison</b> (February 11, 1847 – October 18, 1931) was an American inventor and businessman, who has been described as America's greatest inventor.
</p>
<p>
Edison developed many devices that greatly influenced life around the world, including the phonograph, the motion picture camera, and the long-lasting, practical electric light bulb.</p>
<p>Dubbed "The Wizard of Menlo Park", he was one of the first inventors to apply the principles of mass production and large-scale teamwork to the process of invention, and is often credited with the creation of the first industrial research laboratory.
</p>
</div>
<div id="influence">
<h3>Influencial Inventions</h3>
<p>
Edison was a prolific inventor, holding 1,093 US patents in his name, as well as many patents in the United Kingdom, France, and Germany.
</p>
<p>
More significant than the number of Edison's patents was the widespread impact of his inventions: <b>electric light and power utilities</b>, <b>sound recording</b>, and <b>motion pictures</b> all established major new industries worldwide.
</p>
<p>
Edison's inventions contributed to mass communication and, in particular, telecommunications. These included the following:
<ul>
<li>a stock ticker</li>
<li>a mechanical vote recorder</li>
<li>a battery for an electric car</li>
<li>electrical power</li>
<li>recorded music and motion pictures</li>
</ul>
</p>
</div>
<div id="videos">
<h3>Documentary: The Wizard of Menlo Park</h3>
<iframe src="https://www.youtube.com/embed/laSvFBKWODo" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
<h3>Edison Vs. Tesla: War or Currents</h3>
<iframe src="https://www.youtube.com/embed/fWkSLJtMfhg" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</div>
<div id="quotes">
<h3>Inspiring Quotes</h3>
<p>
Edison often spoke about the <i>importance of persistance</i>. Here are some of his inspiring quotes:
<blockquote cite="https://www.brainyquote.com/quotes/thomas_a_edison_132683"><q>
I have not failed. I've just found 10,000 ways that won't work.
</blockquote>
<blockquote cite="https://www.brainyquote.com/quotes/thomas_a_edison_149049"><q>
Our greatest weakness lies in giving up. The most certain way to succeed is always to try just one more time.</blockquote>
You can read more of his inspiring quotes on <a href="https://www.brainyquote.com/authors/thomas_a_edison" target="_blank">BrainyQuote.com</a>.
</p>
</div>
</div>
<p id="read-more">
You can read more about the successes (and failures) of this great inventor on the
<a id="tribute-link" href="https://en.wikipedia.org/wiki/Thomas_Edison" target="_blank">Thomas Edison</a> Wikipedia page. Many books have been written about Thomas Edison, and you can browse some of them on <a id="books-link" href="https://www.amazon.co.uk/s/ref=nb_sb_noss_2?url=search-alias%3Ddigital-text&field-keywords=edison+thomas" target="_blank">Amazon</a>.
</p>
</section>
<footer>
<p id="credit">Created by <a class="white-link" href="https://github.com/hakabuk" target="_blank">Michal Weizman</a>
</footer>
</section>
</body>
body {
background-color: #618685;
}
#main {
font-family: arial;
background-color: white;
width: 95%;
margin: auto;
box-shadow: 1px 1px 1px black;
}
#top {
text-align: center;
color: #618685;
}
#title {
color: #f09b00;
font-family: 'Lobster', sans-serif;
letter-spacing: 0.1rem;
font-size: 50px;
text-shadow: 2px 2px 2px black;
padding-bottom: 0;
margin-bottom: 0px;
margin-top: 10px;
padding-top: 10px;
}
#tag-line {
font-size: 24px;
line-height: 0px;
margin-top: 10px;
padding-bottom: 20px;
text-shadow: 0.5px 0.5px 0.5px grey;
}
#img-div {
position: relative;
max-width: 70%;
margin: auto;
top: 0;
left: 0;
}
#image {
position: relative;
display: block;
max-width:100%;
max-height:100%;
box-shadow: 5px 5px 7px grey;
border-radius: 50%;
top: 0;
left: 0;
}
#light-bulb-off {
width: 20%;
position: absolute;
top: 8%;
left: 14%;
transform: rotate(-30deg);
}
#light-bulb-on {
width: 20%;
position: absolute;
top: 8%;
left: 14%;
transform: rotate(-30deg);
-webkit-filter: drop-shadow(0px 0px 25px yellow);
}
@keyframes blink {
0% {
opacity: 0;
}
25% {
opacity: 1;
}
26% {
opacity: 0;
}
27% {
opacity: 1;
}
28% {
opacity: 0;
}
30% {
opacity: 1;
}
33% {
opacity: 0;
}
37% {
opacity: 1;
}
80% {
opacity: 1;
}
100% {
opacity: 0;
}
}
#light-bulb-on {
animation: blink 3s;
animation-iteration-count: infinite;
}
#img-caption {
text-align: center;
margin-top: 10px;
margin-bottom: 30px;
font-size: 16px;
}
h3 {
color: #388785;
}
#tribute-info {
max-width: 70%;
margin: auto;
}
#general {
grid-area: general;
}
#influence {
grid-area: influence;
}
#videos {
grid-area: videos;
}
#quotes {
grid-area: quotes;
}
blockquote {
width: 90%;
margin: 10px 0px 10px 0px;
padding: 10px;
background-color: rgba(240,155,0, 0.2);
}
#read-more {
grid-area: read-more;
width: 101%;
}
.container {
display: grid;
grid-template-columns: 50% 50%;
grid-gap: 25px;
align-items: stretch;
grid-template-areas:
"general influence"
"videos quotes"
"read-more read-more";
}
#general, #influence, #quotes, #videos, #read-more {
background-color: rgba(255, 232, 193,0.6);
padding: 10px;
border-radius: 10px;
box-shadow: 1px 1px 3px black;
}
iframe {
width: 95%;
}
a, a:visited, a:hover {
color: #544530;
}
.white-link, .white-link:visited, .white-link:hover {
color: white;
}
#credit {
background-color: #f09b00;
text-align: center;
padding: 5px 0px;
color: white;
font-size: 12px;
}
@media (max-width: 800px) {
#tag-line {
padding-bottom: 0px;
font-size: 20px;
}
#img-caption {
font-size: 14px;
}
#tribute-info {
max-width: 90%;
margin: auto;
}
#img-div {
max-width: 90%;
}
.container {
grid-template-columns: 100%;
grid-gap: 15px;
grid-template-areas:
"general"
"influence"
"videos"
"quotes"
"read-more";
}
#read-more {
width: 100%;
box-sizing: border-box;
}
}
Also see: Tab Triggers