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 lang="en">
<head>
<link rel="stylesheet" href="style.css">
<title>Manchester Bands</title>
</head>
<body>
<div id="main">
<h1 id="title">Manchester Bands</h1>
<div id="img-div">
<img id="image" src="https://cdn.pixabay.com/photo/2016/08/30/16/13/manchester-1631200_960_720.jpg"
alt="Sewer cover with manchester written on">
<fig-caption id="img-caption">Manchester has produced the best musicians for genarations.</fig-caption>
</div>
</div>
<article id="tribute-info">
<h2 id="headline">Here are some of Manchesters finest</h2>
<ul>
<li><strong>1991-2009-Oasis</strong> Formed in Manchester in 1991, the same year as Chesney Hawkes released 'one
and only' thank god he was a one hit wonder. <strong>"Supersonic"</strong> was the debut single for the
Manchester Band. Written by lead guitarist Noel Gallagher.Released on 11 April 1994 as Oasis' debut single and
later appeared on their debut album<strong> Defintely Maybe in August</strong> 1994. </li>
<li><strong>1983-Stone Roses</strong> the stone Roses were the leaders of the <strong> "Madchester"</strong>
scene. The leaders of British guitar culture from the late 80s and early 90s. Their debut album became an
English sensation and other groups followed <strong>The Charlatans</strong>, <strong>Inspiral Carpets</strong>
and <strong> Happy Mondays.</strong></li>
<li>The Smiths 1982-1987</li>
<li>Take That Since 1990</li>
<li>The Chemical Broters Since 1989</li>
</ul></article>
<footer>
<blockquote>
<p>"If it stopped banging on about its football teams and its bands and its shops and its attitude,Manchester
has something that it can be genuinely, enormously proud of, something it should shout from the rooftops.<br>
Manchester changed the world's politics: vegetarianism to feminism to trade unionism to communism, every
upstart notion that ever got ideas above its station, every snotty street-fighter of a radicial philosophy,
was fostered brawling in Manchester's streets, mills, pubs, churches and debating halls."</p>
</blockquote>
<strong>Stuart Maconie</strong><br><strong>Stuart Maconie is a DJ, radio and TV presenter and writer, and
this quote comes from his book Pies and Prejudice: in Search of the North.</strong>
<h3>If you would like to find out more about the Manchester music scene take a look at
<a id="tribute-link" href="https://www.prideofmanchester.com/music/top100.htm" target="_blank">Pride Of
Manchester</a>
</h3>
</footer>
<script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>
</body>
</html>
html,body{
font-family:"Roboto Slab",
Helvetica, sans-serif;
text-align:center;
min-width:500;
color:#330333;
}
#main{
margin:10px auto;
padding:30px;
border:15px solid;
border-radius:20px;
background:#eee;
}
h1 {
color: red;
text-shadow: 1px 1px 1px black;
background: linear-gradient(to bottom, rgba(0,0,0,0.25),
rgba(0,0,0,0,.1));
padding: 3px;
text-align: center;
box-shadow: inset 45px 45px 45px rgba(0,0,0,0.5), inset -2px -2px 5px
rgba(255,255,255,0.5);
}
#headline{
margin-top:100px;
text-align:center;
color:black;
text-shadow: 5px 5px 3px red;
}
img{
max-width:100%;
display:block;
height:auto;
margin:auto;
}
#img-div{
margin:-5px;
margin-top:20px;
width:100%;
border:5px black;
background:black;
}
#img-caption{
margin:10px;
color: aliceblue;
}
ul{
max-width:600px;
margin:0 auto;
text-align:center;
}
li{
margin:20px;
}
Also see: Tab Triggers