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>
<link href="https://fonts.googleapis.com/css2?family=Baloo+Bhai+2:wght@600&display=swap" rel="stylesheet">
</head>
<main id="main">
<h1 id="title">Abraham Lincoln</h1>
<p>16th President of the United States</p>
<hr>
<figure id="img-div">
<img src="https://www.historyhit.com/app/uploads/2020/07/lincoln2-3.jpg" alt="Lincoln in November 1863" id="image">
<figcaption id="img-caption">Lincoln in November 1863</figcaption>
</figure>
<section id="tribute-info">
<p>Abraham Lincoln ( February 12, 1809 – April 15, 1865) was an American statesman and lawyer who served as
the 16th president of the United States from 1861 to 1865. Lincoln led the nation through the American
Civil War, the country's greatest moral, constitutional, and political crisis. He succeeded in
preserving the Union, abolishing slavery, bolstering the federal government, and modernizing the U.S.
economy.</p>
<p>Lincoln was born into poverty in a log cabin and was raised on the frontier primarily in Indiana. He was
self-educated and became a lawyer, Whig Party leader, Illinois state legislator, and U.S. Congressman
from Illinois. In 1849 he returned to his law practice but became vexed by the opening of additional
lands to slavery as a result of the Kansas–Nebraska Act. He reentered politics in 1854, becoming a
leader in the new Republican Party, and he reached a national audience in the 1858 debates against
Stephen Douglas. Lincoln ran for President in 1860, sweeping the North in victory. Pro-slavery elements
in the South equated his success with the North's rejection of their right to practice slavery, and
southern states began seceding from the union. To secure its independence, the new Confederate States
fired on Fort Sumter, a U.S. fort in the South, and Lincoln called up forces to suppress the rebellion
and restore the Union.</p>
<p>As the leader of moderate Republicans, Lincoln had to navigate a contentious array of factions with
friends and opponents on both sides. War Democrats rallied a large faction of former opponents into his
moderate camp, but they were countered by Radical Republicans, who demanded harsh treatment of the
Southern traitors. Anti-war Democrats (called "Copperheads") despised him, and irreconcilable
pro-Confederate elements plotted his assassination. Lincoln managed the factions by exploiting their
mutual enmity, by carefully distributing political patronage, and by appealing to the U.S. people. His
Gettysburg Address became a historic clarion call for nationalism, republicanism, equal rights, liberty,
and democracy. Lincoln scrutinized the strategy and tactics in the war effort, including the selection
of generals and the naval blockade of the South's trade. He suspended habeas corpus, and he averted
British intervention by defusing the Trent Affair. He engineered the end to slavery with his
Emancipation Proclamation and his order that the Army protect and recruit former slaves. He also
encouraged border states to outlaw slavery, and promoted the Thirteenth Amendment to the United States
Constitution, which outlawed slavery across the country.
</p>
<p>Lincoln managed his own successful re-election campaign. He sought to heal the war-torn nation through
reconciliation. On April 14, 1865, just days after the war's end at Appomattox, Lincoln was attending a
play at Ford's Theatre with his wife Mary when he was assassinated by Confederate sympathizer John
Wilkes Booth. His marriage had produced four sons, two of whom preceded him in death, with severe
emotional impact upon him and Mary. Lincoln is remembered as the martyr hero of the United States and he
is consistently ranked as one of the greatest presidents in American history.</p>
<p>As you came till here, spare some more time to read about <a href="https://en.wikipedia.org/wiki/Abraham_Lincoln" target="_blank" id="tribute-link">Abraham
Lincoln</a> </p>
</section>
<hr>
</main>
<footer>Developed by Junaid Shaikh</footer>
body {
margin: 0;
padding: 0;
background-color: #ddd8d8;
box-sizing: border-box;
font-family: "Baloo Bhai 2", cursive;
}
#title {
text-align: center;
font-size: 3rem;
color: red;
text-shadow: 2px 2px 1px rgb(0, 0, 0);
margin: -22px;
}
h1 + p {
text-align: center;
background-color: darkkhaki;
font-size: 1rem;
}
img {
max-width: 100%;
height: auto;
display: block;
margin: auto;
padding: 10px;
}
#img-caption {
text-align: center;
text-decoration: underline;
}
#tribute-info {
display: block;
margin: auto;
padding: 20px;
width: 50vw;
line-heigh: 2;
}
a:visited {
color: black;
}
footer {
text-align: center;
text-decoration: underline;
}
@media only screen and (max-width:700px){
#tribute-info{
width: 80vw;
}
}
Also see: Tab Triggers