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.
<body>
<header>
<h1>Freemote Blog</h1>
<p>Written by Aaron Jack who lives wherever he wants, and works whenever he wants.</p>
</header>
<article>
<section id="section-1" class="container">
<div id="top-blog" class="top-blog-container">
<div id="top-img" class="top-div">
<img class="blog-cover" src="https://practiceblog.freemote.com/img/big-post.png" alt="An artistic rendering of a man coloring a large rainbow finger print on top of a street that is also simultaneously a swimming pool filled with ocean creatures.">
</div>
<div id="top-title" class="top-div details">
<h2>How to make your web design unique</h2>
<h3>What makes visual content unique & how to create it without breaking the rules</h3>
<div class="author">
<img src="https://practiceblog.freemote.com/img/me.png" alt="Profile picture of Aaron Jack, holding his hand to his face in a thoughtful manner.">
<div class="author-details">
<p>Aaron Jack</p>
<p>May 10 - 12 Min Read</p>
</div>
</div>
</div>
</div>
</section>
<section id="section-2" class="container">
<div class="lower-blog-container">
<div id="lower-img" class="lower-div">
<img class="blog-cover" src="https://practiceblog.freemote.com/img/post-2.png" alt="An artistic rendering of many little people trying to hold up a wavy piece of printer paper that displays a webpage on it.">
</div>
<div id="lower-title" class="lower-div details">
<h2>Landing for Business</h2>
<h3>When does your business need a landing page?</h3>
<div class="author">
<img src="https://practiceblog.freemote.com/img/me.png" alt="Profile picture of Aaron Jack, holding his hand to his face in a thoughtful manner.">
<div class="author-details">
<p>Aaron Jack</p>
<p>May 10 - 12 Min Read</p>
</div>
</div>
</div>
</div>
<div class="lower-blog-container">
<div id="lower-img" class="lower-div">
<img class="blog-cover" src="https://practiceblog.freemote.com/img/post-3.png" alt="An artistic rendering of 'the hand of god' (from Michelangelo's 'The Creation of Adam' painting) pressing a button on a computer screen that's floating in a galaxy.">
</div>
<div id="lower-title" class="lower-div details">
<h2>Dashboard Design</h2>
<h3>Anatomy of an effective dashboard</h3>
<div class="author">
<img src="https://practiceblog.freemote.com/img/me.png" alt="Profile picture of Aaron Jack, holding his hand to his face in a thoughtful manner.">
<div class="author-details">
<p>Aaron Jack</p>
<p>May 10 - 12 Min Read</p>
</div>
</div>
</div>
</div>
<div class="lower-blog-container">
<div id="lower-img" class="lower-div">
<img class="blog-cover" src="https://practiceblog.freemote.com/img/post-4.png" alt="An artistic rendering of a computer screen floating in a galaxy">
</div>
<div id="lower-title" class="lower-div details">
<h2>UI Secrets They Don't Want You To Know</h2>
<h3>Secrets uncovered after years in the industry</h3>
<div class="author">
<img src="https://practiceblog.freemote.com/img/me.png" alt="Profile picture of Aaron Jack, holding his hand to his face in a thoughtful manner.">
<div class="author-details">
<p>Aaron Jack</p>
<p>May 10 - 12 Min Read</p>
</div>
</div>
</div>
</div>
</section>
</article>
</body>
*, *::before, *::after {
box-sizing: border-box;
margin: 0;
padding: 0;
list-style: none;
text-decoration: none;
}
/* ---------- BODY DECLERATIONS ---------- */
body {
background-color: rgba(205, 205, 205, .5);
font-family: 'Merriweather', serif;
height: 100vh;
margin: 0 auto;
max-width: 1200px;
min-width: 750px;
width: 100%;
}
header {
border-bottom: 2px solid white;
padding: 50px 0;
}
header > * {
margin: 10px 0;
}
h1, h2, h3, h4, h5, h6 {
font-family: 'Montserrat', sans-serif;
}
h1, h2 {
font-weight: 900;
}
h3 {
font-size: 1rem;
}
/* ---------- SECTION DECLERATIONS ---------- */
.blog-cover {
border: 10px solid white;
width: 100%;
}
.author img {
border-radius: 100px;
margin-right: 10px;
max-width: 40px;
}
.author {
display: flex;
}
.details > * {
margin: 10px 0;
}
/*
#section-1 #top-img {
background-image: url(https://practiceblog.freemote.com/img/big-post.png?_ga=2.215293143.1972798017.1629544597-1430136248.1618667935);
background-size: cover;
background-position: center;
}
*/
/* ---------- UPPER SECTION ---------- */
.top-blog-container,
.lower-blog-container {
display: flex;
height: auto;
margin-top: 30px;
}
#top-blog {
gap: 1.5rem;
}
#top-img {
flex-grow: 2;
width: 200%;
}
#top-title {
display: flex;
flex-direction: column;
flex-grow: 1;
justify-content: center;
transform: translateX(1rem);
width: 100%;
}
#top-title h2{
font-size: 1.8rem;
}
#top-title h3{
font-size: 1.2rem;
}
/* ---------- LOWER SECTION ---------- */
#section-2 {
display: flex;
flex-direciton: row;
gap: 2.5rem;
}
.lower-blog-container {
display: flex;
flex-direction: column;
height: auto;
width: 100%;
}
.lower-div img {
display: block;
width: 100%;
}
#lower-title {
justify-content: center;
}
Also see: Tab Triggers