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>
<!DOCTYPE html>
<title>
James Clerk Maxwell
</title>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="styles/style1.css" type="text/css">
</head>
<body>
<div id="main">
<h1 id="title">James clerk maxwell</h1>
<div id="img-div">
<img id="image" src="http://www.hddocumentary.com/wp-content/uploads/2017/01/vlcsnap-2016-01-27-12h21m08s055.jpg" alt="James Clerk Maxwell">
<div id="img-caption">the man who changed the world</div>
</div>
<div id="tribute-content">
<div class="paragraph">Whether you are talking on your cell phone, watching your favorite television program, surfing the web, or using your GPS to guide you on a trip, these are all modern conveniences made possible by the foundational work of the 19th century Scottish physicist James Clerk Maxwell. Though Maxwell didn’t discover electricity and magnetism, he did put in place a mathematical formulation of electricity and magnetism that built upon the earlier work of Benjamin Franklin, André-Marie Ampère, and Michael Faraday.<br>
His most notable achievement was to formulate the classical theory of electromagnetic
readiation, bringing together for the first time Electricity, Magnetism, and Light
as different manifestations of the same phenomenon</div>
<div class="paragraph">
Maxwell was an expert in several distinct fields of science:
<ul id="list1">
<li>Electromagnetism</li>
<li>Astronomy</li>
<li>Motion Of Gases</li>
<li>Optics</li>
</ul>
</div>
<div id="paragraph">
He produced outstanding work in all areas.<br>
Maxwell's equations for electromagnetism have been called the <span id="capitalize">"second great
unification in physics"</span> after the first one realised by Isaac Newton.<br>
Maxwell was genius from an early age. He wrote his first scientific paper at age 14.
In his paper, he described a mechanical means of drawing mathematical curves with a piece of string, and the properties of Ellipses, Cartesian Ovals, and related curves with more than two foci.<br>
Maxwell was educated first at the University of Edinburgh and later at Cambridge University, and he became a fellow of Trinity COllege in 1855. He was professor of natural philosophy at Aberdeen University from 1856 to 1860 and occupied the chair of natural philosophy and astronomy at King's Colege, University of London, form 1860 to 1865.<br><br><br>
<strong>The major contributions of Maxwell in the field of Science are:</strong>
<ul id="contributions">
<li>Investigation of the motions of Saturn's Rings</li>
<li>Colour Perception of humans</li>
<li>World's first color photograph</li>
<li>Kinetic Theory Of Gases</li>
<li>Laws Of Electricity And Magnetism</li>
<li>Electromagnetic Theory Of Light</li>
</ul>
<br>
Maxwell’s work helped us understand phenomena from the small wavelength X-rays that are widely used in medicine to the much longer wavelength waves that allow the propagation of radio and television signals. The follow-up developments of Maxwell’s theory have given the world all forms of radio communication including broadcasting and television, radar and navigational aids, and more recently the smart phone, which allows communication in ways not dreamt of a generation ago. When Albert Einstein’s theories of space and time, a generation after Maxwell’s death, upset almost all of “classical physics,” Maxwell’s equation remained untouched—as valid as ever.
<br>
</div>
<div id="quote">
<blockquote><em>"From a long view of the history of mankind—seen from, say, ten thousand years from now—there can be little doubt that the most significant event of the 19th century will be judged as Maxwell's discovery of the laws of electrodynamics."</em></blockquote>
<span id="author">— Richard P Feynman (physicist)</span>
</div>
<div id="footer"><h3>Read more about the work and life of James Clerk Maxwell <a id="tribute-link" href="https://en.wikipedia.org/wiki/James_Clerk_Maxwell" target="_blank">here.</a></h3>
</div>
</div>
</body>
</html>
body{
background: linear-gradient(#c9ffbf, #ffafbd);
font-family: archivo, helvetica;
margin: 20px 100px;
}
#tribute-content{
font-size: 20px;
margin: 40px;
}
#capitalize{
text-transform: capitalize;
}
#img-caption{
padding: 5px;
font-size: 20px;
font-weight: bold;
text-transform: uppercase;
padding-top: 0px;
text-align: center;
}
#title{
text-align: center;
font-size: 48px;
color: indigo;
text-transform: uppercase;
}
#img-div{
border: 15px solid white;
background-color: white;
width: 100%;
margin-bottom: 30px;
}
#image{
width: 100%;
}
#quote{
background: #e3e3e3;
padding: 5px;
margin: 10px;
}
#author{
margin-left: 50px;
}
@media screen and (max-width: 800px){
body{
margin: auto;
}
#tribute-content{
margin: 5px;
font-size: 16px;
}
#img-caption{
padding: 0px;
font-size: 10px;
}
#title{
font-size: 20px;
}
#img-div{
border: 5px solid white;
margin-bottom: 20px;
}
#image{
width: 100%;
}
#img-div{
width: 100%;
}
#author{
margin-left: 8px;
}
#quote{
margin: 0px;
}
#footer{
font-size: 12px;
}
}
// !! IMPORTANT README:
// You may add additional external JS and CSS as needed to complete the project, however the current external resource MUST remain in place for the tests to work. BABEL must also be left in place.
/***********
INSTRUCTIONS:
- Select the project you would
like to complete from the dropdown
menu.
- Click the "RUN TESTS" button to
run the tests against the blank
pen.
- Click the "TESTS" button to see
the individual test cases.
(should all be failing at first)
- Start coding! As you fulfill each
test case, you will see them go
from red to green.
- As you start to build out your
project, when tests are failing,
you should get helpful errors
along the way!
************/
// PLEASE NOTE: Adding global style rules using the * selector, or by adding rules to body {..} or html {..}, or to all elements within body or html, i.e. h1 {..}, has the potential to pollute the test suite's CSS. Try adding: * { color: red }, for a quick example!
// Once you have read the above messages, you can delete all comments.
Also see: Tab Triggers