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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.
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.
If the stylesheet 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 CSS 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.
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>
<link href="https://fonts.googleapis.com/css?family=Cedarville+Cursive|Open+Sans:400,700&display=swap" rel="stylesheet">
<div id="main">
<div id="img-div">
<figure>
<img id="image" src="https://www.dagsavisen.no/polopoly_fs/1.920768.1486122516!
/image/image.jpg_gen/derivatives/169_1600/image.jpg" alt="Portrait picture of Tønes">
<figcaption id="img-caption"><p>The legendary, humble Norwegian musician relaxing in his
home village</figcaption>
</figure>
</div><!-- img-div -->
<h1 id="title">Frank Tønnesen</br> (a.k.a Tønes)</h1>
<div id="tribute-info">
<article>
<header>
<p>The real name of this Norwegian musician is Frank Tønnesen, but everybody knows him just as Tønes.
Tønes is famous in Norway for singing in his special Sokndal dialect about the small details of everyday life or the funny characters he has met throughout his life. He performs with his guitar and also uses a backing band. Allthough he experienced years of tremendous success in his musical career, he didn´t stop working as an electrician in his home town until 2015. He still lives there, and believes it helps him stay grounded.</p>
<img src="https://jjberg83.github.io/myImageLibrary/tones_.jpeg" alt="Another portrait picture of Tønes">
</header>
<h2>Frank´s life in bullet points</h2>
<ul>
<li><p class="right-tilt"><span class="year">1972</span></p><p>Tønes is born in Sokndal, near Egersund in Rogaland county, Norway.</p></li>
<li><p class="left-tilt"><span class="year">1996</span></p><p>Releases the album "Rett te håves"</p></li>
<li><p class="right-tilt"><span class="year">1998</span></p><p>Releases the album "Gobai"</p></li>
<li><p class="left-tilt"><span class="year">1998</span></p><p>Releases the EP "Maleri"</p></li>
<li><p class="right-tilt"><span class="year">1999</span></p><p>Releases the EP "Bonde", still one of his most popular songs</p></li>
<li><p class="left-tilt"><span class="year">2000</span></p><p>Releases the album "Det så e inne i krabben"</p></li>
<li><p class="right-tilt"><span class="year">2000</span></p><p>Releases the EP "Sko ikke sagt någe hvis det va drid"</p></li>
<li><p class="left-tilt"><span class="year">2003</span></p><p>Releases the EP "Sju"</p></li>
<li><p class="right-tilt"><span class="year">2004</span></p><p>Releases the album "Grønnare gras"</p></li>
<li><p class="left-tilt"><span class="year">2008</span></p><p>Releases the album "Tørk av deg fliret"</p></li>
<li><p class="right-tilt"><span class="year">2009</span></p><p>Releases the album "Sobihob"</p></li>
<li><p class="left-tilt"><span class="year">2009</span></p><p>Nominated to the Norwegian national award Spellemannprisen for the lyrics in "Sobihob"</p></li>
<li><p class="right-tilt"><span class="year">2012</span></p><p>Releases the album "Sån av Salve"</p></li>
<li><p class="left-tilt"><span class="year">2012</span></p><p>Won the Prøysenprisene award</p></li>
<li><p class="right-tilt"><span class="year">2012</span></p><p>Nominated to Nordic Music Prize for his effort in the album "Sån av Salve"</p></li>
<li><p class="left-tilt"><span class="year">2012</span></p><p>Won Spellemannprisen in the folk category for his album "Sån av Salve"</p></li>
<li><p class="right-tilt"><span class="year">2012</span></p><p>Won Spellemannprisen for the lyrics in the album "Sån av Salve"</p></li>
<li><p class="left-tilt"><span class="year">2013</span></p><p>Wins the Norwegian dialect award </p></li>
<li><p class="right-tilt"><span class="year">2013</span></p><p>Won Stavanger Aftenblads culture award</p></li>
<li><p class="left-tilt"><span class="year">2015</span></p><p>Releases the album "Vindbrest"</p></li>
<li><p class="right-tilt"><span class="year">2015</span></p><p>Won Spellemannprisen for the folk category for his album "Vindbrest"</p></li>
<li><p class="left-tilt"><span class="year">2015</span></p><p>Nominated for Spellemannprisen for the lyrics in the album "Vindbrest"</p></li>
<li><p class="right-tilt"><span class="year">2017</span></p><p>Releases the album "Sesong fire"</p></li>
<li><p class="left-tilt"><span class="year">2017</span></p><p>Releases the EP "Ikkje mogna"</p></li>
<li><p class="right-tilt"><span class="year">2017</span></p><p>Releases the single "Maxitaxi"</p></li>
<li><p class="left-tilt"><span class="year">2017</span></p><p>Nominated for Spellemannprisen in the "Best lyrics" category</p></li>
<li><p class="right-tilt"><span class="year">2017</span></p><p>Nominated for Spellemannprisen in the "Album of the year" category</p></li>
</ul>
<footer class="side-footer">
<a href="https://open.spotify.com/artist/5A4ovj9I91UgF79mLirtz6" target="_blank" id="tribute-link"><img src="https://jjberg83.github.io/myImageLibrary/Spotify_Logo_RGB_Green.png" alt="Spotify logo"></a>
</footer>
<p class="quote">Sånn koga eg!</p>
</article>
</div><!-- tribute-info -->
</div> <!-- main -->
html {
box-sizing: border-box;
font-family: 'Open Sans', sans-serif;
}
*, *:before, *:after {
box-sizing: inherit;
}
body {
background: url("https://jjberg83.github.io/myImageLibrary/dynamic-style/dynamic-style.png");
}
#main {
display: flex;
flex-direction: column;
align-items: center;
max-width: 800px;
margin: 0 auto;
text-align: center;
}
footer {
background: #34391a;
padding: 10px;
margin-left: -1px;
width: 90px;
position: fixed;
top: 400px;
left: 0;
}
footer img {
max-width: 100%;
height: auto;
display: block;
}
header img, figure img {
height: auto;
display: block;
box-shadow: 0 2px 10px 5px rgba(0,0,0,0.19), 0 3px 10px 5px rgba(0,0,0,0.23);
border: 25px solid #fdf8e7;
}
header img {
width: 60%;
transform: rotate(0.7deg);
margin: 50px auto;
}
figure img {
max-width: 100%;
transform: rotate(-0.7deg);
}
h1, h2, .year, figcaption, .quote {
font-family: 'Cedarville Cursive', cursive;
}
figcaption {
font-size: 22px;
transform: rotate(-0.7deg);
margin-top: 0;
}
#main h1 {
font-size: 60px;
color: #85756a;
line-height: 1.2;
margin-bottom: 0;
}
#main h2 {
font-size: 40px;
color: #34391a;
}
#main figure {
margin: 25px 0 0 0;
}
#main ul {
list-style: none;
}
#main li {
margin-top: 25px;
}
.year {
font-size: 20px;
color: #ccc766;
background: #34391a;
padding: 0 8px;
}
.right-tilt {
transform: rotate(2deg);
}
.left-tilt {
transform: rotate(-2deg);
}
.quote {
font-size: 60px;
transform: rotate(-6deg);
margin-top: 70px;
text-align: center;
color: #85756a;
}
@media (max-width: 1000px) {
footer {
padding: 10px;
width: 90px;
position: static;
margin: 20px auto 0 auto;
background: none;
}
header img, figure img {
border-width: 15px;
}
#main h1 {
font-size: 40px;
line-height: 1em;
}
#main h2 {
font-size: 35px;
line-height: 0.9em;
}
.quote {
font-size: 40px;
line-height: 1em;
margin-top: 20px;
}
figcaption p {
line-height: 1.2em;
font-size: 19px;
}
footer img {
margin-top: 20px;
}
}
Also see: Tab Triggers