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.
<!doctype html>
<html lang="en">
<link href="https://fonts.googleapis.com/css?family=Oswald" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=EB+Garamond" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="style2.css">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous">
<title>Tribute2</title>
</head>
<body>
<div id="main" class="container-flux">
<header class="header">
<h1 class="headerBig">Freddie Mercury</h1>
<h2> mad man in the best sense possible.</h2>
</header>
<div id="img-div">
<img id="image" src="http://wyspa.fm/image/2/1140/650/5/uploads/news/fred2-59f978a8ea980.jpg" alt="Image of Freddie Mercury at age 33 goes here" >
<p id="img-caption">Freddie Mercury at age 33</p>
</div><hr>
<section>
<header id="tribute-info">Here's an overview of Freddie Mercury's life:</header>
<ul id="list">
<li><b>1946</b> - Born September 5 on the East African island of Zanzibar as Farrokh Bulsara</li>
<li><b>1953</b> - Freddie started taking piano lessons</li>
<li><b>1954</b> - Moved to Panchgani, India to enter boarding school</li>
<li><b>1958</b> - Started his first school band, The Hectics</li>
<li><b>1963</b> - Moved back to his parents in Zanzibar</li>
<li><b>1964</b> - The Bulsara family fled Zanzibar due to a revolution, and moved to Feltham, Middlesex, England</li>
<li><b>1966</b> - Freddie entered the London based Ealing College of Art</li>
<li><b>1968</b> - Freddie made friends with Brian May and Roger Taylor of the band Smile, through another Ealing Art student and Smile basss player Tim Staffell</li>
<li><b>1969</b> - He left Ealing College with a diploma in graphic art and design and became singer for London band Ibex (later that year called Wreckage). Late that year Ibex ended and Freddie joined Sour Milk Sea</li>
<li><b>1970</b> - Tim Staffell parted with Smile. Freddie joined the band and renamed it Queen</li>
<li><b>1971</b> - John Deacon joined Queen and they started recording their first album</li>
<li><b>1973</b> - Freddie released his first solo single under the pseudonym Larry Lurex</li>
<li><b>1979</b> - He performed with the Royal Ballet</li>
<li><b>1984</b> - Freddie contributed the song Love Kills to the new soundtrack of 1929 movie Metropolis. The song was written by Freddie and Giorgio Moroder</li>
<li><b>1985</b> - First solo album Mr. Bad Guy released</li>
<li><b>1987</b> - Freddie discovered that he was contracted with HIV</li>
<li><b>1988</b> - Mercury released an album with opera singer Montserrat Caballé, called Barcelona</li>
<li><b>1991</b> - November 24 Freddie Mercury died of Aids-related bronchial pneumonia.</li>
</ul>
</section><hr>
<!-- Freddie's solo discography -->
<section class="discography">
<h4 class="header">Freddie Mercury solo discography - click on a record to listen</h4>
<div class="records">
<!-- image item #1 -->
<figure class="img-item">
<a href="https://www.youtube.com/watch?v=KbqMD29qi58" target="_blank"><img src="https://pm1.narvii.com/6942/420cdd6b5936812bcc1f20c065d6a9cfa7fd0e91r1-1000-1000v2_hq.jpg" alt="Mr.BAD GUY ">
<figcaption class="img-description">
<p>1988 Mr.BAD GUY</p>
</figcaption></a>
</figure>
<!-- image item #2 -->
<figure class="img-item">
<a href="https://youtu.be/UPUa8foTDcg" target="_blank"><img src="https://upload.wikimedia.org/wikipedia/en/e/e5/Barcelona_Album_Cover.jpg" alt="Y ahora qué?">
<figcaption class="img-description">
<p>1988 Barcelona</p>
</figcaption></a>
</figure>
</section>
<aside>
<p class="aside">If you have time, you should read more about this incredible human being on his <a id="tribute-link" href="https://en.wikipedia.org/wiki/Freddie_Mercury" target="_blank">wikipedia entry</a>.</p>
</aside>
<hr>
<footer>
<p>Copyright 2019 PM</p>
</footer>
</div>
</body>
</html>
html, body {
max-width: 800px;
min-width: 360px;
margin-left: auto;
margin-right: auto;
}
body {
padding: 15px;
}
#main{
margin:30px;
background:#eee;
margin-left: auto;
margin-right: auto;
padding: 5%;
}
.header {
font-family: 'Oswald';
text-align: center;
font-size: 13pt;
}
img {
max-width: 100%;
display: block;
height: auto;
}
#img-caption {
text-align: center;
}
.img-description {
font-size: 1em;
color: red;
}
.img-item {
max-width: 300px;
text-align: center;
margin-left: auto;
margin-right: auto;
}
li {
font-family: 'EB Garamond'
}
footer {
font-family: 'EB Garamond';
text-align: right;
font-size: 0.7em;
}
Also see: Tab Triggers