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>
<head>
<meta charset="UTF-8">
<title>Fredy Mercury</title>
</head>
<body>
<main id="main">
<div class="div-title">
<h1 id="title">Freddy Mercury</h1>
<h4>A man with an unique voice.</h5>
</div>
<div id="img-div">
<img id="image" src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQytXtJNek2q0xtCHCR2L1z5Z1RElmYDpEeBQ&usqp=CAU" title="Freddy Mercury" alt="Freddy Mercury">
<p id="image-caption">Freddy Mercury on stage</p>
</div>
<h2 id="tribute-info">Here's a time line for Freddy Mercury</h2>
<div class=div-list>
<ul>
<li>1946 (5th September) Freddie Mercury was born Farrokh Bulsara to Bomi and Jer Bulsara in Stone Town, Zanzibar (Tanzania). His father worked as a cashier at the British Colonial Office</li>
<li>1953 (during) Freddie began taking piano lessons.</li>
<li>1954 (during) Freddie was sent to St Peter’s Boarding School in Panchgani, Bombay, India.</li>
<li>1958 (during) Freddie formed ‘The Hectics’ a school band that played covers of popular songs. Around this time he began to use the christian name Freddie.</li>
<li>1964 (12th January) The Zanzibar Revolution forced Freddie and his family to leave Zanzibar. They fled to England where they lived in Feltham.</li>
<li>1966 (Autumn) Freddie studied Art and Design at Ealing Art College.</li>
<li>1968 (Autumn) Freddie became friends with art student Tim Staffell who, along with astonomy student Brian May had formed the group Smile.</li>
<li>1969 (during) Freddie joined Liverpool band ‘Ibex’ and moved to Liverpool where he lived in a flat.</li>
<li>1970 (early) When Freddie’s friend, Tim Staffell, left the group Smile, Freddie Bulsara persuaded Brian May and group drummer Roger Taylor that he should replace Staffell as lead singer.</li>
<li>1970 (early) Encouraged by Freddie, the band Smile changed their name to Queen.</li>
<li>1970 (18th July) The group Queen made their first performance.</li>
<li>1972 (during) Freddie Mercury designed a crest logo for Queen.</li>
<li>1973 (during) Freddie released the single ‘I Can Hear Music/Goin’ Back’ under the pseudonym Larry Lurex but it didn’t do very well.</li>
<li>1973 (during) Freddie released the single ‘I Can Hear Music/Goin’ Back’ under the pseudonym Larry Lurex but it didn’t do very well.</li>
<li>1985 (around) Freddie began a relationship with Barbara Valentin an Austrian actress. Soon after he met Jim Hutton, a hairdresser and began a relationship with him.</li>
<li>1985 (29th April) Freddie released a solo album ‘Mr Bad Guy. It reached number 6 in the UK but did not do well in the US.</li>
<li>1987 (23rd February) Freddie released the single ‘The Great Pretender’, a cover of the Platters song. It reached number 5 in the UK.</li>
<li>1987 (April) Freddie Mercury was diagnosed with AIDS. The diagnosis was kept from the public.</li>
<li>1987 (5th September) Freddie had a huge birthday party on the island of Ibiza. Around 700 guests attended.</li>
<li>1988 (8th October) Freddie Mercury and Montserrat Caballe performed ‘Barcelona’ in Barcelona to celebrate the arrival of the Olympic flag from Seoul.</li>
<li>1988 (10th October) Freddie Mercury and Montserrat Caballe released the album ‘Barcelona’. It reached number 15 in the UK and number 6 in the US.</li>
<li>1990 (during) Freddie Mercury denied rumours that he was very ill.</li>
<li>1991 (June) Freddie retired from public life to his home in Kensington. He was cared for by Jim Hutton and former girlfriend and lifelong friend, May Austin.</li>
<li>1991 (23rd November) Freddie Mercury publicly announced that he had AIDS.</li>
<li>1991 (24th November) Freddie Mercury died of bronchial pneumonia which he had contracted as a complication of AIDS.</li>
<li>1991 (27th November) After a funeral service at West London Crematorium, Freddie’s friend, Mary Austin took his ashes and buried them at an unknown location.</li>
</ul>
</div>
<div class="div-cite">
<p>[...] Freddie Mercury, an extraordinary rock star who rushed across our cultural landscape like a comet shooting across the sky. [...] The bright light of his talent exhilarates us even now that his life has been so cruelly extinguished it needn't have happened, it shouldn't have happened. Please let's not [let] it happen again.</p>
<br>
<cite>-- Elizabeth Taylor</cite>
</div>
<p class="p-link"> 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" rel="noopener noreferrer" title="link to Wikipedia">Wikipedia page</p>
</main>
</body>
</html>
* {
margin: 0;
font-family: Georgia, "Times New Roman", Times, serif;
color: #2f4f4f;
background-color: #d3d3d3;
}
.div-title {
text-align: center;
padding: 30px;
background-color: #A9A9A9;
}
#title {
padding: 15px;
font-size: 40px;
background-color: #A9A9A9;
}
.div-title h4{
background-color: #A9A9A9;
}
#img-div {
text-align: center;
padding: 25px;
}
#image {
width: 40%;
height: auto;
}
#image-caption {
font-size: 20px;
}
#tribute-info {
padding: 25px;
text-align: center;
font-size: 40px;
}
.div-list {
margin: 0 25%;
font-size: 20px;
text-align: justify;
}
.div-cite{
margin: 80px 15%;
border: 2px solid #2F4F4F;
border-radius: 20px;
padding: 15px;
}
.div-cite p{
font-size: 20px
text-align: justify;
}
.div-cite cite{
}
.p-link{
margin: 50px 0 15px 0;
text-align:center;
}
.p-link a:hover{
color: #008080;
}
Also see: Tab Triggers