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>
<head>
<meta charset="UTF-8">
<title> Niki Lauda: Tribute Page </title>
</head>
<body>
<main id="main">
<h1 id="title">Niki Lauda (1949-2019)</h1>
<h3>The man who came back from death</h3>
<div id="img-div">
<img id="image" src="https://autoblog.com.ar/wp-content/uploads/2019/05/LAUDA.jpg" alt="A picture of Niki Lauda in his final years">
<figcaption id="img-caption">A picture of Niki Lauda in his final years</figcaption>
</div>
<section id="tribute-info">
<p>Niki Lauda was born in 1949, to a wealthy family, and became a racing driver despite his family's disapproval. He started racing in F1 in 1972 for the March team, where he had a terrible season. The next year he bought his way into BRM. </p>
<h4>His time at Ferrari</h4>
<p>In 1974, he joined Ferrari, the biggest name in Formula One. Here, he would win two world championships and fall victim to his famous accident.</p>
<p>His first world championship came in 1975, where the team also secured its first constructor's championship in eleven years. He also became the first driver to lap the legendary Nordschleife in under 7 minutes.</p>
<h5>1976: his famous rivalry and horrific crash</h5>
<p>1976 was to be the most difficult year of his life. He started the year almost uncontested, winning the majority of the races. Nearest rivals James Hunt and Jody Scheckter were far away and nobody counted on any of them to challenge him.</p>
<p>But alas, it was not to be. In the 1976 German Grand Prix, held at the terrifying and unforgiving Nürburgring Nordschleife, his luck would take a terrible turn. He was famously against the race being held due to the appalling safety conditions at the time. He also remarked, rather ominously, that the fire safety was deficient. It was to be the cause of his near-demise.</p>
<p>On the Sunday of the Grand Prix, he had a huge crash during the second lap, on a very fast corner. His car hit an embankment and then was violently launched into the track, and was hit by another car. It burst into flames. Other drivers who had arrived at the scene hurriedly left their cars to aid him. After much struggle, they managed to extricate him from the car. However, he had inhaled toxic gases and suffered severe burns to his head.</p>
<p>He spent several weeks in hospital, stubbornly refusing to die. He had a skin graft done to reconstruct his eyelids. Much to the surprise of everyone, he returned six weeks after, to the Italian Grand Prix. There, with no compromise to his speed but in inmense pain, he managed to achieve a decent result. At the final race, the Japanese Grand Prix, he retired as he felt driving in the torrential rain to be too risky. Hunt won the championship.</p>
<div id="rush-snippet"><p><i>This incident was depicted on the 2013 film "Rush", directed by Ron Howard.</i></p></div>
<p>After 1977, where he won another World Championship, he left Ferrari, as he hadn't felt supported by them during his perils. He was to be replaced by the late Gilles Villeneuve, an illustrious racer.</p>
<h4>The twilight of his career</h4>
<p>He spent two unremarkable years at Brabham, later retiring in 1979. After his retirement he dedicated himself to working full-time at his newly created airline, <i>Lauda Air</i>.</p>
<p>Nevertheless, he returned in 1982, signing with the McLaren team. In 1983 he won his third and final championship, in dramatic fashion, narrowly beating his teammate, a young frenchman by the name of Alain Prost, by half a point. Prost went on to win 4 World Championships.</p>
<h4>His final years</h4>
<p>He continued doing business with Lauda Air, and several airlines after that. He insistently pressured airplane maker <i>Boeing</i> to conduct an investigation after an accident in one of his planes claimed the lives of everyone on board</p>
<p>In 2012 he joined Mercedes AMG Formula 1 Team in an advisory role. He managed to poach Lewis Hamilton from McLaren, who went on to win championships in 2014, 2015, 2017, 2018, and 2019. Lewis Hamilton is nearing Schumacher's record 91 wins, having already surpassed every one of his records. Mercedes is now one of the most successful teams in the history of Formula One. Lauda, a very popular personality in the paddock, passed away in 2019. He will be sorely missed.</p>
</section>
<h2>Read more about his life in his <a id="tribute-link" href="https://en.wikipedia.org/wiki/Niki_Lauda" target="_blank">Wikipedia article.</a></h2>
</main>
</body>
#main {
padding: 20px 0px 20px 0px;
background-color: lightgray;
text-align: center;
font-family: "Baskerville Old Face", "Bodoni Bk BT", "Century", serif;
position: relative;
}
#tribute-info {
display: block;
text-align: center;
margin: 0 auto;
font-size: 20px;
max-width: 50%;
/*background-color:white;*/
}
h1 {
font-size:55px;
}
h3 {
font-weight:normal;
font-family: Book Antiqua, sans-serif;
}
h4 {
font-size: 25px;
}
#img-caption {
font-size: 110%;
}
#img-div {
margin: 20px;
padding: 0px 0px 10px 0px;
display: center;
background-color: white;
align-items: center;
position: relative;
}
#image {
display: block;
position: relative;
margin: auto;
padding: 40px 0px 20px 0px;
max-width: 90%;
}
#rush-snippet {
max-width: 40%;
position: relative;
padding: 0px 10px 0px 10px;
margin: 0px 0px 15px 20px;
background-color:gray;
color:white;
float:right;
}
// !! IMPORTANT README:
// You may add additional external JS and CSS as needed to complete the project, however the current external resource MUST remain in place for the tests to work. BABEL must also be left in place.
/***********
INSTRUCTIONS:
- Select the project you would
like to complete from the dropdown
menu.
- Click the "RUN TESTS" button to
run the tests against the blank
pen.
- Click the "TESTS" button to see
the individual test cases.
(should all be failing at first)
- Start coding! As you fulfill each
test case, you will see them go
from red to green.
- As you start to build out your
project, when tests are failing,
you should get helpful errors
along the way!
************/
// PLEASE NOTE: Adding global style rules using the * selector, or by adding rules to body {..} or html {..}, or to all elements within body or html, i.e. h1 {..}, has the potential to pollute the test suite's CSS. Try adding: * { color: red }, for a quick example!
// Once you have read the above messages, you can delete all comments.
Also see: Tab Triggers