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.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>CSS Tricks</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;800&display=swap" rel="stylesheet">
</head>
<body>
<section>
<main>
<h1>About Patty</h1>
<p>Patty Meltt, born Patricia Lynn Melton, grew up in a modest household on the outskirts of Nashville, Tennessee. From a young age, she was drawn to country music and her parents, both music lovers, filled their home with the sounds of country legends like Patsy Cline, Loretta Lynn, and Dolly Parton.</p>
<p>Patty’s parents scraped together enough money to buy her a secondhand guitar. From that moment on, Patty poured her heart and soul into mastering the instrument, spending countless hours practicing and crafting her own songs.</p>
<p>Patty began performing at local talent shows, gaining recognition for her raw talent and soulful voice. Encouraged by the positive feedback, she started performing at small venues around Nashville, honing her skills and building a loyal fanbase.</p>
<p>Her perseverance paid off when she caught the attention of a local talent scout who helped her land her first record deal. She released a string of hit singles and albums, earning accolades for her distinctive voice and heartfelt songwriting. With each performance, she captivated audiences with her authenticity and passion, solidifying her as one of country music’s stars.</p>
</main>
<figure>
<img src="https://res.cloudinary.com/malarkey/image/upload/v1736973067/CSS%20Tricks%20articles/2025-01-15-1.webp" alt="">
</figure>
</section>
<!-- Next -->
<section>
<main>
<h1>About Patty</h1>
<p>Patty Meltt, born Patricia Lynn Melton, grew up in a modest household on the outskirts of Nashville, Tennessee. From a young age, she was drawn to country music and her parents, both music lovers, filled their home with the sounds of country legends like Patsy Cline, Loretta Lynn, and Dolly Parton.</p>
<p>Patty’s parents scraped together enough money to buy her a secondhand guitar. From that moment on, Patty poured her heart and soul into mastering the instrument, spending countless hours practicing and crafting her own songs.</p>
<p>Patty began performing at local talent shows, gaining recognition for her raw talent and soulful voice. Encouraged by the positive feedback, she started performing at small venues around Nashville, honing her skills and building a loyal fanbase.</p>
<p>Her perseverance paid off when she caught the attention of a local talent scout who helped her land her first record deal. She released a string of hit singles and albums, earning accolades for her distinctive voice and heartfelt songwriting. With each performance, she captivated audiences with her authenticity and passion, solidifying her as one of country music’s stars.</p>
<p>Her perseverance paid off when she caught the attention of a local talent scout who helped her land her first record deal. She released a string of hit singles and albums, earning accolades for her distinctive voice and heartfelt songwriting.</p>
<h2>Whiskey Sunrise: Live in Nashville by Patty Meltt</h2>
<p>Patty Meltt’s latest live album, Whiskey Sunrise: Live in Nashville, captures the essence of a true country music experience. Recorded during an electrifying performance at Nashville’s iconic Ryman Auditorium, this album showcases Meltt’s ability to blend raw emotional depth with the celebratory spirit of a live audience. From the opening track, “Whiskey Sunrise,” Meltt sets the tone with her signature blend of heartache and resilience. The song’s vivid imagery of long nights, lost love, and bittersweet mornings perfectly encapsulates the album’s themes. Her voice, rich with grit and tenderness, commands attention as it weaves through each song, supported by a stellar live band.</p>
<p>Tracks like “Hollowed-Out Heart” and “Two-Steppin’ Alone” resonate with heartfelt honesty, while upbeat numbers such as “Nashville Neon” and “Boots on the Barstool” bring the energy of the concert to life. The instrumentation shines, from the twang of the pedal steel guitar to the rhythmic stomp of the drums, all balanced to perfection. A standout moment is her acoustic rendition of “Backroads and Memories,” where Meltt’s stripped-down vocal performance holds the audience in rapt silence. The live setting amplifies the intimacy of this song, making it a highlight of the album. What truly sets Whiskey Sunrise: Live in Nashville apart is Meltt’s interaction with the crowd. Between songs, she shares anecdotes that feel like conversations with an old friend, deepening the listener’s connection to her music.</p>
</main>
</section>
</body>
</html>
:root {
--spacing-r: 1.5rem;
--spacing-l: 3rem; }
html {
background-color: #150F0A;
-webkit-text-size-adjust: 100%;
overflow-x: hidden;
scroll-behavior: smooth; }
body {
margin: 0 auto;
padding-block-end: var(--spacing-l);
padding-inline: var(--spacing-l);
max-inline-size: 105rem;
background-color: #150F0A;
color: #fff;
font-family: "Poppins", serif;
font-weight: 400;
font-style: normal;
font-size: 1em; }
h1 {
margin-block: 0 var(--spacing-r);
border-bottom: 5px solid #98838F;
font-family: "Poppins", serif;
font-weight: 800;
font-style: normal;
line-height: 1;
text-transform: uppercase;
color: #98838F; }
p {
margin: 0;
orphans: 3; }
p + p {
text-indent: 2ch; }
img {
border-width: 0;
content-visibility: auto;
max-inline-size: 100%;
inline-size: 100%;
block-size: auto; }
figure,
figure img {
margin: 0;
padding: 0; }
section {
margin-block-end: var(--spacing-l); }
/* DEMO STARTS */
/* <section> contains no <figure> (default) */
main {
container-type: inline-size;
margin-inline: auto;
max-width: 100ch;
column-width: 40ch;
column-gap: var(--spacing-l);
column-rule: .5px solid #98838F; }
h1 {
font-size: clamp(5.6526rem, 5.4068rem + 1.2288cqi, 6.3592rem);
column-span: all; }
h2 {
font-size: clamp(1.9994rem, 1.9125rem + 0.4347cqi, 2.2493rem);
column-span: all; }
p {
font-size: clamp(1rem, 0.9565rem + 0.2174cqi, 1.125rem); }
/* <section> contains a <figure> */
section:has(> figure) {
display: flex;
flex-wrap: wrap;
gap: 0 var(--spacing-l); }
section:has(> figure) main {
flex: 1;
margin-block-end: var(--spacing-r);
margin-inline: 0;
padding-block-start: var(--spacing-r);
min-width: min(100%, 30rem); }
section:has(> figure) figure {
flex: 4;
min-width: min(100%, 30rem); }
Also see: Tab Triggers