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="main">
<h1 id="title">Andreas Nikolaus "Niki" Lauda</h1>
<h4>Three-time F1 World Drivers Champion</h4>
<code>(freeCodecamp Tribute page)</code>
<br><br>
<figure id="img-div">
<img
id="image"
src="https://i.redd.it/z1le1dt4105y.jpg"
alt="Niki Lauda inside his Ferrari Formula 1"
/>
<br>
<figcaption id="img-caption">
Niki Lauda was an Austrian Formula One driver, a three-time F1 World Drivers' Champion, <strong>winning in 1975, 1977 and 1984</strong>, and an aviation entrepreneur.
</figcaption>
</figure>
<section id="tribute-info">
<h3 id="headline">The life and times of Niki Lauda, who has died at the age of 70:</h3>
<ul>
<li><strong>1949</strong> - Andreas Nikolaus Lauda born on February 22 in Vienna, Austria</li>
<li>
<strong>1968</strong> - Without telling his parents, who disapprove of motor racing, Lauda wins his first race in a Mini
</li>
<li>
<strong>1971</strong> - Takes out a loan to buy a seat in the new March team in Formula Two
</li>
<li>
<strong>1971</strong> - Promoted to March Formula One team. Makes grand prix debut in Austria on August 15
Forestry Service
</li>
<li>
<strong>1973</strong> - Takes another loan to buy his way into BRM team
</li>
<li>
<strong>1974</strong> - Gets a huge break when former BRM teammate Clay Regazzoni recommends him to Ferrari. Lauda finishes second in Argentina on Ferrari debut
</li>
<li>
<strong>1974</strong> - Enjoys his first grand prix victory in Spain on April 28 in his fourth race for Ferrari
</li>
<li>
<strong>1975</strong> -Emerges as Formula One's star driver as he becomes world champion for the first time, winning five of 14 grands prix and taking nine pole positions
</li>
<li>
<strong>1976</strong> - Suffers horrific burns and lung damage in a fiery crash at the Nuerburgring and is read the last rites in hospital. Miraculously misses only two races and is pipped to the title by James Hunt
</li>
<li>
<strong>1977</strong> - Wins his second world championship with Ferrari with consistent podium finishes and victories in South Africa and the Netherlands
</li>
<li>
<strong>1978</strong> - Joins the Bernie Ecclestone-owned Brabham team for a reported $1 million salary
</li>
<li><strong>1979</strong> - Retires from the sport during practice for the Canadian Grand Prix in September, saying he "no longer wishes to drive round in circles" for the struggling Brabham outfit</li>
<li>
<strong>1979</strong> - Founds Lauda Air, his first foray into the aviation industry
</li>
<li>
<strong>1982</strong> - Returns to racing with McLaren
</li>
<li>
<strong>1984</strong> - Becomes world champion for a third time by the smallest of margins -- half a point over teammate Alain Prost
</li>
<li>
<strong>1985</strong> - Records the last of 25 grand prix wins in the Netherlands and retires for good
</li>
<li>
<strong>1993</strong> - Returns to Formula One as a consultant for Ferrari
</li>
<li>
<strong>2001</strong> - Appointed team principal for Jaguar
</li>
<li>
<strong>2002</strong> - Sells Lauda Air to Austrian Airlines
</li>
<li>
<strong>2004</strong> - Creates low-cost carrier Niki, which he sells to Air Berlin in 2011
</li>
<li>
<strong>2012</strong> - Appointed non-executive chairman of Mercedes F1 and is instrumental in bringing in Lewis Hamilton to spark a run of five consecutive world championships
</li>
<li>
<strong>2018</strong> - Has emergency lung transplant in August
</li>
<li>
<strong>2019</strong> - Dies peacefully in his sleep on May 20
</li>
</ul>
</section>
<section>
<h3>Niki Lauda interesting facts</h3>
<p>Some experts consider 1979 Formula 1 season one of the best of all time, the same year when Niki suffer the accident that causes his burns. James Hunt won the championship of that season and Niki was by a single point. Niki and James, despite being great rivals, were cole friendly and are considered one of the most remembered rivalries of all Formula 1 history.</p>
<blockquote
cite="http://news.rediff.com/report/2009/sep/14/pm-pays-tribute-to-father-of-green-revolution-borlaug.htm">
<p>
"There are good pilots and bad pilots. Then there are those who are very talented and very difficult to beat. James was one of them"
</p>
<cite>-- Niki Lauda</cite>
</blockquote>
<p>There is a movie called <a href="https://www.imdb.com/title/tt1979320/" target="_blank">Rush</a> that is about the rivality of Niki Lauda and James Hunt and is focused on the F1 1976 season. This movie is in the <a href="https://www.imdb.com/chart/top" target="_blank">IMDb 250 best rated movies</a> of all times.<p>
<figure>
<img src="https://m.media-amazon.com/images/M/MV5BOWEwODJmZDItYTNmZC00OGM4LThlNDktOTQzZjIzMGQxODA4XkEyXkFqcGdeQXVyNjU0OTQ0OTY@._V1_SY1000_SX675_AL_.jpg" alt="Rush movie poster">
</figure>
<h3>
Read more about this great Formula 1 pilot on his
<a
id="tribute-link"
href="https://en.wikipedia.org/wiki/Niki_Lauda"
target="_blank"
>Wikipedia entry</a
>.
</h3>
</section>
</main>
html {
/* Setting a base font size of 10px give us easier rem calculations
Info: 1rem === 10px, 1.5rem === 15px, 2rem === 20px and so forth
*/
font-size: 10px;
}
body {
/* Native font stack https://getbootstrap.com/docs/4.2/content/reboot/#native-font-stack */
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
font-size: 2rem;
line-height: 1.5;
text-align: center;
color: #333;
margin: 0;
padding: 0;
}
h1 {
font-size: 6rem;
margin-bottom: 0;
}
@media (max-width: 460px) {
h1 {
font-size: 3.5rem;
line-height: 1.2;
}
}
h3 {
font-size: 3.25rem;
}
a {
color: #477ca7;
}
a:visited {
color: #74638f;
}
#main {
margin: 30px 8px;
padding: 15px;
border-radius: 5px;
/* background: #eee; */
}
@media (max-width: 460px) {
#main {
margin: 0;
}
}
img {
max-width: 60%;
display: block;
height: auto;
margin: 0 auto;
border-radius: 30px;
border:7px solid black;
}
#img-div {
background: white;
padding: 10px;
margin: 0;
}
#img-caption {
margin: 15px 0 5px 0;
}
@media (max-width: 460px) {
#img-caption {
font-size: 1.4rem;
}
}
#headline {
margin: 50px 0;
text-align: center;
}
ul {
max-width: 550px;
margin: 0 auto 50px auto;
text-align: left;
line-height: 1.6;
}
li {
margin: 16px 0;
}
p {
max-width: 85%;
margin: 0 auto 50px auto;
text-align: left;
line-height: 1.6;
}
blockquote {
font-style: italic;
max-width: 545px;
margin: 0 auto 50px auto;
text-align: center;
}
// coded by @ChaituVR
const projectName = 'tribute-page';
localStorage.setItem('example_project', 'Tribute Page');
Also see: Tab Triggers