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.
<!--
This is a work in progress tribute page that I am building for the
freeCodeCamp 'Reactive Web Design' certification.
-->
<div id="main">
<div id="title">
<p>Joey Dunlop</p>
</div>
<section id="tribute-info">
<h1>Becoming a Motorcycling Icon</h1>
<p>
William Joseph Dunlop was a Northern Irish motorcycilist from Ballymoney, born Febuary 25th 1952. Joey's career racing motorcycles is beyond impressive. He began racing in 1969 and up until 2000 racked up 26 Ilse of Man TT wins, 13 wins at the North West 200, and over 160 other wins elsewhere. This extensive list of achivements in motorycle racing has not been surpassed by anyone else since- and may never be.
</p>
<div id="img-div">
<img alt="Photo of Joey Dunlop" id="img" src="https://www.causewaycoastandglens.gov.uk/uploads/general/32._Joey_Dunlop.jpg">
<p id="img-caption">Joey Dunlop</p>
</div>
<h1>Racing Timeline</h1>
<ul>
<li>1976 Joey raced for the first time in England, at Oulton Park. The Armoy Armada became so popular that sponsor John Rea bought a bus to bring fans from the Railway tavern, Ballymoney, to race meetings. Joey competed at the Isle of Man TT, winning a Bronze Replica for best newcomer.</li>
<li>1977 Won his first Isle of Man TT race, the Jubilee Classic.</li>
<li>1979 First victories at the North West 200, winning the Superbike races and also at the Ulster Grand Prix in the 500cc and Superbike races.</li>
<li>1982 Joey won the TT Formula One World Motorcycle Championships which he retained until 1986. He dominated the championship during the 1980s, also finishing 3rd in 1980 & 1981 and runner-up in 1987 & 1988.</li>
<li>1985 Another astonishing season which included a hat-trick of wins at both the Ulster Grand Prix and the TT, a double victory at the NW200 and Formula One wins in Holland, Portugal, Spain and Germany. Joey's TT victories were all the more remarkable as he narrowly missed drowning when the fishing boat taking him to the Isle of Man was sunk.</li>
<li>1996 Joey was honoured with an OBE in recognition of his humanitarian deeds. He drove alone across Eastern Europe to take aid to Romania, Bosnia and Albania.</li>
<li>2000 Another triple win at the TT brought Joey's tally to 26 and, in recognition of this astonishing feat, he was presented with the Manx Sword of State.</li>
</ul>
<div id="img-div">
<img id="img" alt="Photo of Joey Dunlop preparing to race" src="https://upload.wikimedia.org/wikipedia/commons/8/87/JoeyDunlopTT92.jpg">
<p id="img-caption">Dunlop preparing for the Senior TT in 1992</p>
</div>
<h1>The Last Lap</h1>
<p>
On July 2nd, 2000, Joey Dunlop was killed while racing in Estonia. He will go on living in the hearts of fans as the 'King of the Roads'. If you would like to know more about Joey Dunlops life, you can read about it <a id="tribute-link" href="https://en.wikipedia.org/wiki/Joey_Dunlop#:~:text=In%202016%20he%20was%20voted,by%20fans%20of%20motorcycle%20racing." target="_blank">here</a>
</p>
</section>
<div id="footer">
<p>Made by Carsen Weinzetl | For FCC Responsive Web Design Certification</p>
</div>
</div>
/* Desktop View / Larger VW */
html {
background-color: white;
}
#main {
display: grid;
margin: 30px 15%;
font-family: Tahoma;
}
#title {
background-color: #3066be;
text-align: center;
font-size: 90px;
color: #e0e0e0;
}
#tribute-info {
background-color: #e0e0e0;
font-size: 20px;
}
#footer {
background-color: #3066be;
color: #e0e0e0;
text-align: center;
}
#img {
width: 70%;
margin-left: auto;
margin-right: auto;
display: grid;
}
#img-caption {
font-size: 15px;
text-align: center;
}
#tribute-link {
color: #3066be;
}
p {
margin: 25px 7%;
line-height: 140%;
}
h1 {
margin: 3% 0% 2% 5%;
font-size: 30px;
font-family: Tahoma;
}
li {
margin: 25px 7%;
line-height: 140%;
}
/* Mobile view / Smaller VW */
@media (max-width: 1000px) {
#main {
display: grid;
margin: -10px;
}
#title {
background-color: ;
text-align: center;
font-size: 70px;
}
#body {
background-color: lightgray;
}
#footer {
background-color: #3066be;
color: #e0e0e0;
text-align: center;
margin-bottom: -8px;
}
#img {
width: 100%;
margin-left: auto;
margin-right: auto;
display: grid;
}
#img-caption {
font-size: 15px;
text-align: center;
}
#tribute-link {
color: #3066be;
}
p {
margin: 10px;
}
h1 {
margin: 10px;
font-size: 30px;
}
}
Also see: Tab Triggers