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 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.
<html>
<head>
<link rel="stylesheet" type="text/css" ahref="#">
<title> My Tribute Page </title>
</head>
<body>
<h1 id="title" style="text-align: center;"> My Tribute To W.E.B. Du Bois</h1>
<p id="tag" style="text-align: center;"> Sociologist & African American Activist </p>
<h4 id="quote" style="text-align: center;"> "To be a poor man is hard, but to be a poor race in a land of dollars is the very bottom of hardships."</h4>
<main id="main">
<div id="img-div" style="text-align: center;">
<img id="image" style="max-width: 40%;
display: block; margin: 0 auto;" src="https://upload.wikimedia.org/wikipedia/commons/thumb/1/12/WEB_DuBois_1918.jpg/919px-WEB_DuBois_1918.jpg" alt="Photograph of WEB DuBois">
<p id="img-caption" style="text-align: center;"> Photograph Of W.E.B. Du Bois Courtesy of <a href="https://en.wikipedia.org/wiki/W._E._B._Du_Bois" target="_blank">Wikipedia</a> </p>
</div>
<div id="tribute-info">
<h2>Life In Short</h2>
<p id="tribute-brief"> William Edward Burghardt Du Bois was born on February 23 1868 in Great Barrington Massachussetts. In his lifetime, Du Bois worked to overcome the struggles created in the aftermath of the civil war as a nation and a people fought for progress. Being the first african american to graduate from Harvard with a doctorate made him a leader in the community and his evenutal founding of the NAACP remains important to this day. W.E.B. Du Bois was a pillar for the black community by all measures, but accomplishing what he did during such a divisive moment in our history make him a legend among all men.</p>
<h3> Books Written By W.E.B. Du Bois </h3>
<div id="books"><ul>
<li>The Study of the Negro Problems (1898)</li>
<li>The Philadelphia Negro (1899)</li>
<li>The Negro in Business (1899)</li>
<li>The Souls of Black Folk (1903)</li>
<li>"The Talented Tenth", second chapter of The Negro Problem, a collection of articles by African Americans (September 1903)</li>
<li>Voice of the Negro II (September 1905)</li>
<li>John Brown: A Biography (1909)</li>
<li>Efforts for Social Betterment among Negro Americans (1909)</li>
<li>Atlanta University's Studies of the Negro Problem (1897–1910)</li>
<li>The Negro (1915)</li>
<li>The Gift of Black Folk: The Negroes in the Making of America (1924)</li>
<li>Africa, Its Geography, People and Products (1930)</li>
<li>Africa: Its Place in Modern History (1930)</li>
<li>Black Reconstruction in America (1935)</li>
<li>What the Negro Has Done for the United States and Texas (1936)</li>
<li>Black Folk, Then and Now (1939)</li>
<li>Color and Democracy: Colonies and Peace (1945)</li>
<li>The Encyclopedia of the Negro (1946)</li>
<li>The World and Africa (1946)</li>
<li>The World and Africa, an Inquiry into the Part Which Africa Has Played in World History (1947)</li>
<li>Peace Is Dangerous (1951)</li>
<li>I Take My Stand for Peace (1951)</li>
<li>In Battle for Peace (1952)</li>
<li>Africa in Battle Against Colonialism, Racialism, Imperialism (1960)</li>
</ul> </div>
</div>
</main>
<p id="tribute-linkage"> Get access to the writings of W.E.B. Du Bois <a href="https://archive.org/search.php?query=%28%28%22Du+Bois%22+OR+%22DuBois%22%29+AND+%28%22W.+E.%22+OR+William%29%29" target="_blank">here</a> and learn more about his life <a id="tribute-link" href="https://en.wikipedia.org/wiki/W._E._B._Du_Bois" target="_blank">here</a></p>
<script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>
</body>
</html
body{
margin: 0 auto;
width: 100%;
background-color: black;
}
main{
width: 75%;
margin: 0 auto;
padding: 20px;
background-color: white
}
#tribute-linkage{
margin: 10px;
text-align: center;
font-weight: bold;
}
#title, #quote, #tag, #tribute-linkage {
color: white;
}
#tribute-info{
padding: 0 30px;
}
h4{
font-size: 20px;
}
#img-caption{
font-size: 12px;
font-style: italic;
}
Also see: Tab Triggers