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 URLs 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 its URL and the proper URL extension.
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 esm.sh, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ESM 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.
<html>
<div id="main">
<h1 id="title">Muhammad Ali</h1>
<h2 id="sub-title">“He who is not courageous enough to take risks will accomplish nothing in life.”</h2>
<div><img id="img-div" src="https://api.time.com/wp-content/uploads/2016/06/muhammad-ali-cassius-clay-sonny-listen-neil-leifer.jpg?w=800&quality=85" alt="A photo of Muhammad Ali"></div>
<div id="img-caption"><i>Iconic Photo of Muhammad Ali Knocking Out Sonny Liston in 1965 - <a href="https://api.time.com/wp-content/uploads/2016/06/muhammad-ali-cassius-clay-sonny-listen-neil-leifer.jpg?w=800&quality=85" alt="A photo of Muhammad Ali" target="_blank">Photo Source</a></i></div>
<h3 id="timeline-heading"><u>Life History:</u></h3>
<div id="tribute-info">
<p><strong>Jan. 17, 1942:</strong> Cassius Clay is born in Louisville, Kentucky</p>
<p><strong>Sept. 5, 1960:</strong> After winning three bouts in the qualifying round at the Rome 1960 Olympic Games, Cassius Clay defeats Zbigniew Pietrzykowski, of Poland, for the gold medal. Clay was just 18 when he won the gold medal by a decision. </p>
<p><strong> Feb. 25, 1964: </strong>At 22, Ali defeats champion Sonny Liston in a technical knockout to win the world heavyweight boxing crown in Miami</p>
<p><strong> March 6, 1964: </strong>Cassius Clay officially changes his name to Muhammad Ali. Elijah Muhammad, a leader in the Nation of Islam, made a radio broadcast about the name change. Muhammad means “one worthy of praise.” Ali is the name of a cousin of a prophet. </p>
<p><strong> April 1967: </strong>Ali is banned from boxing during the prime of his career and has his title stripped after refusing to fight in the Vietnam War</p>
<p><strong> Oct. 26, 1970: </strong>Ali is reinstated into boxing </p>
<p><strong> March 8, 1971: </strong>“The Fight of the Century” takes place between Ali and Joe Frazier in New York’s Madison Square Garden. Frazier won by a unanimous decision in 15 rounds. The bout marked Ali’s first defeat of his pro career </p>
<p><strong>April 19, 1971: </strong>The legal fight under the case name, Cassius Marsellus Clay, Jr. v. United States was argued before the U.S. Supreme Court </p>
<p><strong> June 28, 1971: </strong>The U.S. Supreme Court reversed Ali’s 1967 conviction. </p>
<p><strong> Jan. 28, 1974: </strong>Ali and Frazier have a rematch in Madison Square Garden. This time, Ali won in 12 rounds. </p>
<p><strong> Oct. 30, 1974: </strong>The famed “Rumble in the Jungle” fight takes place in Zaire and Ali knocks out George Foreman in the eighth round. Ali famously tires out Foreman using the “rope-a-dope” strategy. </p>
<p><strong> Oct. 1, 1975: </strong>Ali took on Frazier for a third (and final) time, this time in the Philippines. Ali beat Frazier in a TKO in the 14th round in what is forever known as “The Thrilla in Manila”</p>
<p><strong>Dec. 30, 1977:</strong> Ali’s daughter, Laila, was born. Laila went on to become a professional boxer. </p>
<p><strong>July 19, 1996:</strong> Ali lights the Olympic cauldron during the Opening Ceremony for the Atlanta 1996 Olympic Games. He also received a replacement gold medal for the one he won in 1960. </p>
<p><strong>June 3, 2016:</strong> Ali dies at age 74 in Phoenix, after being hospitalized with respiratory issues</p>
</div>
<div id="sources-header">
<h3><u>Bibliography:</u></h3>
<ul id="tribute-link">
<li><a href="https://www.teamusa.org/News/2016/June/04/A-Timeline-Of-Muhammad-Alis-Life-And-Career" target="_blank">A TIMELINE OF MUHAMMAD ALI'S LIFE AND CAREER</li>
</ul>
</div>
</html>
body {
background: linear-gradient(180deg, #000000, #D0A103);
color: #000000;
font-family: courier;
}
#main {
}
#title {
color: #D0A103;
text-align: center;
padding: 0em;
font-family: courier;
}
#sub-title {
color: #D0A103;
text-align: center;
font-family: courier;
font-size: 1.2em;
margin-bottom: 2em;
}
#img-div {
border-radius: 3%;
box-shadow: 0px 0px 30px 10px #d32e36;
justify-content: center;
display: block;
margin-left: auto;
margin-right: auto;
width: 60%
}
#img-caption {
padding-top: 25px;
color: #000000
width: 50%;
text-align: center;
font-weight: 500;
}
#timeline-heading {
margin-left: 2%;
margin-right: 2%;
}
#tribute-info {
margin-left: 2%;
margin-right: 2%;
}
#sources-header {
margin-left: 2%;
margin-right: 2%;
}
#tribute-link {
margin-left: 2%;
margin-right: 2%;
}
Also see: Tab Triggers