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.
<div id="main" class="container">
<header class="header">
<figure class="logo">
<img
class="logo-img"
src="https://github.com/orionseth/fccproject-1-tribute/blob/main/img/logo-SN.png?raw=true"
alt="SNES logo"
/>
</figure>
<figure class="logo">
<img
class="logo-img"
src="https://github.com/orionseth/fccproject-1-tribute/blob/main/img/logo-SF.png?raw=true"
alt="Super Famicom logo"
/>
</figure>
</header>
<main>
<h1 id="title" class="heading-primary">The Super Nintendo</h1>
<article id="tribute-info" class="tribute-info">
<section class="section-card">
<div class="card-text">
<h2 class="heading-secondary">Best System</h2>
<p>
The 16-bit Super Nintendo Entertainment System (SNES), or Super
Famicom as it is known in Japan, is regarded by many as the best retro gaming system of all time.
</p>
<p>
It launched in 1990 and sold over 49 million units worldwide.
</p>
</div>
<figure id="img-div" class="card-fig">
<img
id="image"
src="https://github.com/orionseth/fccproject-1-tribute/blob/main/img/console-SN.jpg?raw=true"
alt="Super Nintendo console"
/>
<figcaption id="img-caption">
North American Super Nintendo
</figcaption>
</figure>
</section>
<section class="section-card">
<div class="card-text">
<h2 class="heading-secondary">Games Library</h2>
<p>
The SNES has an impressive lineup of titles. Many games are still sought after today and feature:
</p>
<ul class="features">
<li>catchy soundtracks</li>
<li>colorful sprites</li>
<li>fun gameplay</li>
<li>classic design</li>
</ul>
</div>
<figure class="card-fig">
<img
src="https://github.com/orionseth/fccproject-1-tribute/blob/main/img/chrono-trigger.png?raw=true"
alt="screenshot of Chrono Trigger gameplay"
height="448"
width="512"
/>
<figcaption>
<em>Chrono Trigger (1995)</em>
</figcaption>
</figure>
</section>
<section class="section-card">
<div class="card-text">
<h2 class="heading-secondary">Technical Specification</h2>
<ul class="specifications">
<li>
<strong>Processor:</strong>
<span>16-bit Ricoh @3.58 MHz</span>
</li>
<li>
<strong>Memory:</strong>
<span>128 KB RAM</span>
</li>
<li>
<strong>Video:</strong>
<span>8 mode Picture Processing Unit</span>
</li>
<li>
<strong>Audio:</strong>
<span>Sony S-SMP soundchip</span>
</li>
<li>
<strong>Media type:</strong>
<span>ROM cartridge</span>
</li>
<li>
<strong>Controller Ports:</strong>
<span>2</span>
</li>
</ul>
</div>
<figure class="card-fig">
<img
src="https://github.com/orionseth/fccproject-1-tribute/blob/main/img/dkc.jpg?raw=true"
alt="screenshot of Donkey Kong Country gameplay"
height="448"
width="512"
/>
<figcaption>
<em>Donkey Kong Country (1994)</em>
</figcaption>
</figure>
</section>
<section class="section-card">
<div class="card-text">
<h2 class="heading-secondary">Lifecycle End</h2>
<p>
Games development continued into late 1990s in Japan, and the last Super Famicom game was made in 2000.
</p>
<p>
Producition of the Super Famicom console was discontinued in
2003 when Nintendo ran out of parts to manufacture the system.
</p>
</div>
<figure class="card-fig">
<img
src="https://github.com/orionseth/fccproject-1-tribute/blob/main/img/console-SF.jpg?raw=true"
alt="Super Famicom console"
/>
<figcaption>Japanese Super Famicom</figcaption>
</figure>
</section>
</article>
<aside class="tribute-aside">
<h3>See it in action</h3>
<a
id="tribute-link"
class="tribute-link"
href="https://youtu.be/V1DPaOjTFEM"
target="_blank" >
watch top SNES games →
</a>
</aside>
</main>
</div>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html {
font-size: 62.5%;
}
body {
font-size: 1.8rem;
font-family: 'Montserrat', sans-serif;
color: #343a40;
}
.container {
max-width: 120rem;
padding: 0 3.2rem;
margin: 3.2rem auto 9.6rem;
}
/* Headings */
.heading-primary {
color: #212529;
font-size: 5.2rem;
font-weight: 700;
line-height: 1.15;
letter-spacing: -3px;
text-align: center;
margin-bottom: 4.8rem;
}
.heading-secondary {
font-size: 2.4rem;
font-weight: 500;
letter-spacing: 1px;
margin-bottom: 1.6rem;
line-height: 1.2;
}
/* HEADER */
.header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 9.6rem;
}
.logo {
max-width: 40rem;
}
.logo-img {
max-width: 100%;
display: block;
height: auto;
}
/* ARTICLE */
.tribute-info {
box-shadow: 0 9px 21px rgba(0, 0, 0, 0.1);
border-radius: 2.4rem;
padding: 2.4rem 3.2rem;
margin-bottom: 4.8rem;
display: flex;
flex-direction: column;
gap: 6.4rem;
}
.section-card {
display: flex;
align-items: flex-start;
}
/* Section text */
.card-text {
flex: 0 0 50%;
line-height: 1.65;
}
.card-text p:not(:last-child) {
margin-bottom: 1.2rem;
}
.features {
list-style-type: circle;
list-style-position: inside;
display: flex;
flex-direction: column;
gap: 1.2rem;
}
.features li::marker {
color: #18c8c8;
}
.specifications {
list-style-type: none;
display: flex;
flex-direction: column;
gap: 1.2rem;
}
/* Section figure */
.card-fig {
max-width: 35rem;
margin-left: auto;
}
.card-fig img {
max-width: 100%;
height: auto;
display: block;
border-radius: 2.4rem;
}
.card-fig figcaption {
text-align: center;
color: #71777e;
font-size: 1.6rem;
}
/* ASIDE */
.tribute-aside {
text-align: center;
display: flex;
flex-direction: column;
align-items: center;
gap: 1.2rem;
}
.tribute-aside h3 {
color: #71777e;
font-size: 2rem;
font-weight: 500;
text-transform: uppercase;
letter-spacing: 1px;
word-spacing: 1px;
}
.tribute-link:link,
.tribute-link:visited {
display: inline-block;
font-size: 2rem;
font-weight: 600;
letter-spacing: -1px;
color: #e7121a;
text-decoration: none;
padding-bottom: 2px;
border-bottom: 1px solid currentColor;
transition: all 0.2s ease-out;
line-height: 1.2;
}
.tribute-link:hover,
.tribute-link:active {
color: #b90e15;
border-bottom: 1px solid transparent;
}
/* MEDIA QUERIES */
/* Below 912px */
@media screen and (max-width: 57em) {
body {
font-size: 1.6rem;
}
.header {
flex-flow: column;
gap: 3.2rem;
margin-bottom: 6.4rem;
}
.heading-primary {
font-size: 4.4rem;
margin-bottom: 2.4rem;
}
.tribute-info {
gap: 8rem;
}
.section-card {
flex-direction: column-reverse;
align-items: center;
gap: 3.2rem;
}
.card-text {
max-width: 54rem;
}
.card-fig {
margin: 0;
}
}
/* Below 560px */
@media screen and (max-width: 35em) {
html {
font-size: 56.25%;
}
.container {
padding: 0 1.6rem;
margin: 2.4rem 0 6.4rem 0;
}
.header {
gap: 2.4rem;
}
.heading-primary {
font-size: 3.6rem;
letter-spacing: -1px;
}
.tribute-info {
box-shadow: unset;
padding: 0 1.6rem;
}
.section-card {
gap: 2.4rem;
}
.heading-secondary {
font-size: 2rem;
margin-bottom: 1.2rem;
}
.card-text p:not(:last-child) {
margin-bottom: 0.8rem;
}
}
Also see: Tab Triggers