the build log · view source welcome

FCC BUILD ARCHIVE

This is an archive of everything i've built and shipped from the freeCodeCamp Responsive Web Design v9 Curriculum & Legacy Responsive Web Design V8 Courses.

Everything built on this page include all Workshops, Labs, and Certification Projects (work-in-progress) — chronologically logged from the first to the very last, every line commented and explained. each build shows the code, with a clickable preview tab.

If you are interested in some displays showcasing a bunch of HTML & CSS Fundamentals as well as two builds for The Odin Project, head on over to the Sandbox and peruse all of what i had built from scratch!

*NOTICE: all of the following builds below were intended for my own archival educational purposes. however, do feel free to "steal" any of them and use them however you see fit.

— Enjoy! ^_^

▸ Responsive Web Design v9 68 built · 68 total · worked chronologically
▸ HTML Basic HTML 13 items · 13 built
▸ rwd workshop Build a Curriculum Outline html
Concepts Learnedh1 · h2 · h3 · paragraph elements · heading hierarchy
html
index.html
<h1>Welcome to freeCodeCamp</h1> <!-- the h1 element is commonly utilized as the webpages title -->
<h2>Full-Stack Curriculum</h2> <!-- This is a subheading. -->
<p>Learn the skills to become a full-stack developer</p> <!-- This is a paragraph element. -->

<h3>Introduction to HTML</h3> <!-- used to create sub-subsections under an h2 section -->
<p>HTML represents the content and structure of a webpage</p>

<h3>Introduction to CSS</h3>
<p>CSS is used to style a webpage</p>

<h3>Introduction to JavaScript</h3>
<p>JavaScript adds interactivity to a webpage</p>
preview
▸ rwd lab Debug Camperbot’s Profile Page html
Concepts Learnedheading hierarchy · h1 · h2 · h3 · paragraph elements · debugging invalid tag names · matching opening and closing tags
code
index.html
<h1>Hello from Camperbot!</h1> <!-- h1 is the main title element -->

<h2>About</h2> <!-- h2 is th e first subheading after the main title element h1. as per fCC Instructions: h2 element tags used instead of heading2 because heading2 does not exist. -->

<p>My name is Camperbot and I love learning new things.</p> <!-- p element defines a paragraph of text. as per fCC Instructions: p element tags used instead of pp because pp element tags do not exist. -->

<h3>Background and Interests</h3> <!-- as per fCC instructions /h3 closing tag used to replace incorrect syntax tag of h3/ -->
<p>I enjoy solving puzzles.</p> <!-- as per fCC Instructions: p element tags used instead of pp because pp element tags do not exist. -->
preview
▸ rwd lab Debug a Pet Adoption Page html
Concepts Learnedimg elements · anchor elements · src vs href · alt attributes · void elements · debugging swapped attributes
preview not shown due to fCC lab's use of internal photos
index.html
<h1>Welcome to XYZ Pet Adoption!</h1>
<p>Consider adopting a pet today. We have cats, dogs, rabbits and more.</p>

<h2>See our cats!</h2>
<img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/cats.jpg" alt="Two tabby kittens sleeping together on a couch."> <!-- as per fCC Lab Tests: src used instead of href which is the appropriate attribute to link an external URL) to a page. alt used instead of att which is the appropriate attribute to describe an img element. closing img tag removed is a void element(does not need a closing tag) -->

<h2>Adopt a cat!</h2>
<a href="/cats">Visit cats page</a> <!-- as per fCC Lab Tests: href used instead of src which is appropriate attribute used to link an <a> element to a URL -->

<h2>Adopt a dog!</h2>
<a href="/dogs">Visit dogs page</a> <!-- as per fCC Lab Tests: href used instead of src because href is appropriate attribute used to link an <a> element to a URL-->
▸ rwd workshop Build a Cat Photo App html
Concepts LearnedDOCTYPE · html element · lang attribute · head element · meta element · charset attribute · title element · body element · main element · section element · h1 element · h2 element · h3 element · p element · a element · href attribute · target attribute · _blank value · img element · src attribute · alt attribute · ul element · ol element · li element · figure element · figcaption element · em element · strong element · footer element · nesting · void elements
code
index.html
<!DOCTYPE html> <!-- tells browsers that the document is an HTML5 document-->
<html lang="en"> <!-- html element defines the root of an HTML document. lang attribute sets the language. en value sets language to English -->
<head> <!-- element contains meta information about the webpage -->
  <meta charset="UTF-8"> <!-- meta element specifies the character encoding for the HTML document. charset attribute is the character encoding. UTF-8 value is the standard encoding and can encode mostly all characters, symbols, and emoji -->
  <title>CatPhotoApp</title> <!-- determines what browsers show in the title bar or tab for the page -->
</head>
  <body>
    <main> <!-- identifies the main section of webpage -->
      <h1>CatPhotoApp</h1> <!-- main title of webpage -->
      <section> <!-- defines a section of the webpage -->
        <h2>Cat Photos</h2> <!-- second-level heading (subtitle of webpage) -->
        <p>Everyone loves <a href="https://cdn.freecodecamp.org/curriculum/cat-photo-app/running-cats.jpg">cute cats</a> online!</p>
        <p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p> <!-- anchor element adds a link to cat photos website. _blank opens link in new tab -->
        <a href="https://freecatphotoapp.com"> <img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."> <!-- anchor element around the image links image to cat photos website. element adds image. alt attribute describes the image -->
      </a>
      </section>  
      <section> <!-- defines a section of the webpage -->
        <h2>Cat Lists</h2>
        <h3>Things cats love:</h3>
        <ul> <!-- unordered list element creates a bulleted list -->
          <li>catnip</li>
          <li>laser pointers</li>
          <li>lasagna</li>
        </ul>
        <figure> <!-- figure element groups an image with a caption -->
        <img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/lasagna.jpg" alt="A slice of lasagna on a plate.">
        <figcaption>Cats <em>love</em> lasagna.</figcaption> <!-- caption element provides a description for the image. em places emphasises on text -->
        </figure>
        <h3>Top 3 things cats hate:</h3>
        <ol>
          <li>flea treatment</li>
          <li>thunder</li>
          <li>other cats</li>
        </ol>
        <figure>
          <img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/cats.jpg" alt="Two tabby kittens sleeping together on a couch.">
          <figcaption>Cats <strong>hate</strong> other cats.</figcaption>  
        </figure>
      </section>
    </main>
    <footer> <!-- defines footer for a webpage or section which usually contains info about the author of the webpage, copyright data, links to terms of use, contact information, and more. -->
      <p>
        No Copyright - <a href="https://www.freecodecamp.org">freeCodeCamp.org</a>
      </p>
    </footer>
  </body>
</html>
preview
▸ rwd lab Build a Recipe Page html
Concepts Learnedreinforces learned concepts of: <!DOCTYPE html> • html element • lang attribute • en value • head element • title element • meta element • charset attribute • UTF-8 value • body element • h1 element • h2 element • p element • img element • src attribute • alt attribute
code
index.html
<!DOCTYPE html> <!-- tells browsers that the document is an HTML5 document-->
<html lang="en"> <!-- html element defines the root of an HTML document. lang attribute sets the language. en value sets language to English -->
  <head> <!-- element contains informatiion about the document for the browser, such as metadata, the title. This content is not displayed on the page -->
  <meta charset="UTF-8"> <!-- meta element specifies the character encoding for the HTML document. charset attribute is the character encoding. UTF-8 value is the standard encoding and can encode mostly all characters, symbols, and emoji -->
  <title>Classic Pancakes Recipe</title> <!-- determines what browsers show in the title bar or tab for the page -->
  </head>
  <body> <!-- contains information about the document for the browser, such as metadata and the title (links to stylesheets and scripts will be learned in later in the fCC curriculum) This content is not displayed on the page -->
  <h1>Classic Pancakes</h1> <!-- main title of webpage -->
  <p>Fluffy, golden pancakes made from scratch, perfect for a warm and satisfying homemade breakfast.</p> <!-- contains a paragraph of text -->
  <img src="https://cdn.freecodecamp.org/curriculum/labs/recipe.jpg" alt="A stack of golden pancakes topped with syrup and berries"> <!-- img element displays an image. src attribute points to the image file. alt attribute provides alternative text for screen readers and displays if/when the image cannot load -->
  <h2>Ingredients</h2> <!-- second-level heading -->
  <ul> <!-- creates a bulleted list -->
  <li>1 cup all-purpose flour</li> <!-- list item -->
  <li>2 tablespoons sugar</li>
  <li>1 teaspoon baking powder</li>
  <li>1/2 teaspoon baking soda</li>
  <li>1/4 teaspoon salt</li>
  <li>1 cup buttermilk</li>
  <li>1 large egg</li>
  <li>2 tablespoons melted butter</li>
  </ul>
  <h2>Instructions</h2>
  <ol> <!-- creates a numbered (ordered) list -->
  <li>In a large bowl, whisk together the flour, sugar, baking powder, baking soda, and salt.</li>
  <li>In another bowl, whisk together the buttermilk, egg, and melted butter.</li>
  <li>Pour the wet ingredients into the dry ingredients and stir until just combined.</li>
  <li>Heat a griddle over medium heat and pour 1/4 cup of batter for each pancake.</li>
  <li>Cook until bubbles form on the surface, then flip and cook until golden brown.</li>
  </ol>
  </body>
  </html>
preview
▸ rwd workshop Build a Bookstore Page html
Concepts LearnedReinforced: <!DOCTYPE html> • html element • lang attribute • head element • meta element • charset attribute • UTF-8 value • title element • body element • h1 element • h2 element • p element • nested elements
Introduced: div element • class attribute • id attribute • button element
code
index.html
<!DOCTYPE html> <!-- tells browsers that the document uses HTML5 -->
<html lang="en"> <!-- html element defines the root of an HTML document. lang attribute sets the language. en value sets language to English -->
<head> <!-- contains metadata about the document, such as its title and character encoding -->
  <meta charset="UTF-8"> <!-- meta element specifies the character encoding for the HTML document. charset attribute is the character encoding. UTF-8 value is the standard encoding and can encode mostly all characters, symbols, and emoji -->
  <title>XYZ Bookstore Page</title> <!-- determines what browsers show in the title bar or tab for the page -->
</head>
<body> <!-- contains the visible webpage content that users see and interact with -->
  <h1>XYZ Bookstore</h1> <!-- the main heading of the webpage -->
  <p>Browse our collection of amazing books!</p> <!-- contains a paragraph of text -->
  
  <div class="card-container"> <!-- div element groups related content. class attribute assigns a reusable name that can be shared by multiple elements for styling or selection -->
    <div class="card" id="sally-adventure-book">  <!-- class can be reused across multiple book cards. id uniquely identifies this specific card -->
      <h2>Sally's SciFi Adventure</h2>
      <p>This is an epic story of Sally and her dog Rex as they navigate through other worlds.</p>
      <button class="btn">Buy Now</button> <!-- button element creates an interactive control. class="btn" groups buttons that may share styling -->
    </div>
    <div class="card" id="dave-cooking-book">
      <h2>Dave's Cooking Adventure</h2>
      <p>This is the story of Dave as he learns to cook everything from pancakes to pasta, one recipe at a time.</p>
      <button class="btn">Buy Now</button>
    </div>
  </div>
  <p>Review your selections and continue to checkout.</p>
  <div class="btn-container"> <!-- groups the cart and checkout navigation buttons together -->
    <button class="btn" id="view-cart-btn">View Cart</button> <!-- this button shares the reusable btn class -->
    <button class="btn" id="checkout-btn">Checkout</button>    
  </div>
</body>
</html>
preview
▸ rwd lab Build a Travel Agency Page html
Concepts LearnedReinforced: <!DOCTYPE html> • html element • lang attribute • head element • meta element • charset attribute • UTF-8 value • title element • body element • h1 element • h2 element • p element • a element • href attribute • target attribute • _blank value • img element • src attribute • alt attribute • ul element • li element • figure element • figcaption element • nested elements
Introduced: header element • main element
code
index.html
<!DOCTYPE html> <!-- tells browsers that the document uses HTML5 -->
<html lang="en"> <!-- html element defines the root of an HTML document. lang attribute sets the language. en value sets language to English -->
<head> <!-- contains metadata about the document, such as its title and character encoding -->
  <meta charset="UTF-8"> <!-- meta element specifies the character encoding for the HTML document. charset attribute is the character encoding. UTF-8 value is the standard encoding and can encode mostly all characters, symbols, and emoji -->
  <title>Travel Agency Page</title> <!-- determines what browsers show in the title bar or tab for the page -->
</head>
<body> <!-- contains the visible webpage content that users see and interact with -->
  <header> <!-- contains introductory content, typically a group of introductory or navigational aids -->
    <h1>Wanderlust Travel Agency</h1> <!-- main heading of the webpage -->
    <p>Discover breathtaking destinations around the globe and let us help you plan the trip of a lifetime.</p>  <!-- contains a paragraph of text -->
  </header>
<main> <!-- contains the main content of the document. there should be only one main element per document -->
  <h2>Packages</h2> <!-- represents a subheading of the webpage -->
  <p>We offer a variety of travel packages tailored to fit every type of traveler and budget.</p>
  <ul> <!-- creates an unordered list of items -->
    <li><a href="https://www.freecodecamp.org/learn" target="_blank">Group Travels</a></li> <!-- li element represents a list item. a element creates a hyperlink. href attribute specifies the URL of the page the link goes to. target="_blank" opens the link in a new tab or window -->
    <li><a href="https://www.freecodecamp.org/learn" target="_blank">Private Tours</a></li>
  </ul>
  <h2>Top Itineraries</h2>
  <figure> <!-- represents self-contained content, often with a caption -->
    <a href="https://www.freecodecamp.org/learn" target="_blank">
      <img src="https://cdn.freecodecamp.org/curriculum/labs/colosseo.jpg" alt="The Colosseum in Rome, Italy"> <!-- img element embeds an image into the document. src attribute specifies the path to the image. alt attribute provides alternative text for the image if it cannot be displayed -->
    </a>
    <figcaption>Explore the ancient wonders of Rome, Italy.</figcaption> <!-- provides a caption or legend for the content of the figure -->
  </figure>
  <figure>
    <a href="https://www.freecodecamp.org/learn" target="_blank">
      <img src="https://cdn.freecodecamp.org/curriculum/labs/alps.jpg" alt="Snow-capped peaks of the Alps">
    </a>
    <figcaption>Hike through the stunning peaks of the Alps.</figcaption>
  </figure>
  <figure>
    <a href="https://www.freecodecamp.org/learn" target="_blank">
      <img src="https://cdn.freecodecamp.org/curriculum/labs/sea.jpg" alt="Crystal clear sea and coastline">
    </a>
    <figcaption>Relax on the shores of a crystal-clear sea.</figcaption>
  </figure>
</main>
</body>
</html>
preview
▸ rwd workshop Build an HTML Music Player html
Concepts Learnedaudio element • loop attribute • controls attribute • boolean attributes
code
index.html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Working with the HTML Audio Element</title>
</head>
<body>
  <h1>freeCodeCamp Tunes</h1>

  <h2>Can't Stay Down</h2>
  <p>Artist: Quincy Larson</p>

  <audio src="https://cdn.freecodecamp.org/curriculum/js-music-player/can't-stay-down.mp3" loop controls></audio> <!-- audio element is used to embed sound content in documents. loop attribute makes the audio play in a loop. controls attribute displays the audio controls. loop and controls are boolean values that do not need values -->

  <h2>Cruising for a Musing</h2>
  <p>Artist: Quincy Larson</p>

  <audio src="https://cdn.freecodecamp.org/curriculum/js-music-player/cruising-for-a-musing.mp3" loop controls></audio>

  <h2>Scratching the Surface</h2>
  <p>Artist: Quincy Larson</p>
  
  <audio src="https://cdn.freecodecamp.org/curriculum/js-music-player/scratching-the-surface.mp3" loop controls></audio>  
</body>
</html>
preview
▸ rwd workshop Build an HTML Video Player html
Concepts Learnedvideo element • replaced elements • source element • width attribute • muted attribute • poster attribute • type attribute • video/mp4 value • video/webm value • video/ogg value • video/quicktime value
code
index.html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Working with the HTML Video Element</title>
</head>
<body>
  <h1>Working with the HTML Video Element</h1>
  <video 
    width="640"
    loop
    controls
    muted
    poster="https://cdn.freecodecamp.org/curriculum/labs/past-event2.jpg"
  > <!-- video is a replaced element that adds a video player to your webpage. width attribute sets the width of the video player. loop attribute makes the video play in a loop. controls attribute adds play, pause, and volume controls. muted attribute mutes the audio. poster attribute sets the image that will be displayed before the video starts playing. -->
    <source
      src="https://cdn.freecodecamp.org/curriculum/labs/what-is-the-map-method-and-how-does-it-work.mp4"
      type="video/mp4"
    > <!-- source element specifies the video file and its format. type attribute specifies the format of the video file. video/mp4 value is the format for MP4 videos. -->
    <source
      src="https://cdn.freecodecamp.org/curriculum/labs/mapmethod.webm"
      type="video/webm"
    > <!-- video/webm value is the format for WebM videos. -->
    <source
      src="https://cdn.freecodecamp.org/curriculum/labs/mapmethod.ogg"
      type="video/ogg"
    > <!-- video/ogg value is the format for OGG videos. -->
    <source
      src="https://cdn.freecodecamp.org/curriculum/labs/mapmethod.mov"
      type="video/quicktime"
    > <!-- video/quicktime value is the format for QuickTime videos. -->
  </video>
</body>
</html>
preview
▸ rwd lab Build an HTML Audio and Video Player html
Reinforced Conceptsh1 element • h2 element • section element • video element • audio element • source element • controls attribute • width attribute • src value • loop attribute
code
index.html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  <title>HTML Audio and Video Lab</title>
</head>
<body>
  <h1>My Favorite Video and Song</h1> <!-- h1 element defines the main heading of the page. -->
  <section> <!-- section element groups related content together. -->
    <h2>Learning to Code</h2> <!-- h2 element defines a subheading for the section. -->
    <video controls width="640"> <!-- video element adds a video player to your webpage. controls attribute adds play, pause, and volume controls. width attribute sets the width of the video player. -->
      <source src="https://cdn.freecodecamp.org/curriculum/labs/what-is-the-map-method-and-how-does-it-work.mp4" type="video/mp4"> <!-- source element specifies the video file and its format. src attribute specifies the path to the video file. type attribute specifies the format of the video file. video/mp4 value is the format for MP4 videos. -->
    </video>
  </section>
  <section>
    <h2>Sailing Away</h2>
    <audio controls loop src="https://cdn.freecodecamp.org/curriculum/js-music-player/sailing-away.mp3"></audio> <!-- audio element adds an audio player to your webpage. controls attribute adds play, pause, and volume controls. loop attribute makes the audio play in a loop. src attribute specifies the path to the audio file. -->
  </section>
</body>
</html>
preview
▸ rwd workshop Build a Heart Icon html
Concepts Learnedsvg element • path element • d attribute • width attribute • height attribute • viewBox attribute • fill attribute
code
index.html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>Heart Icon</title>
  </head>
  <body>
    <svg width="24" height="24" viewBox="0 0 24 24" fill="red"> <!-- svg element defines a scalable vector graphic. width and height attributes set the dimensions of the SVG. viewBox attribute defines the coordinate system for the SVG. fill attribute sets the fill color for the shapes within the SVG. -->
      <path
        d="M12 21s-6-4.35-9.33-8.22C-.5 7.39 3.24 1 8.4 4.28 10.08 5.32 12 7.5 12 7.5s1.92-2.18 3.6-3.22C20.76 1 24.5 7.39 21.33 12.78 18 16.65 12 21 12 21z"
      ></path> <!-- path element defines the shape of the heart icon using a series of coordinates and commands. The d attribute contains the path data that describes the outline of the heart shape. -->
    </svg>
  </body>
</html>
preview
▸ rwd workshop Build a Video Display Using iframe html
Introduced Conceptsiframe replaced element • allow attribute • referrerpolicy attribute • accelerometer value • autoplay value • clipboard-write value • encrypted-media value • gyroscope value • web-share value • strict-origin-when-cross-origin value • allowfullscreen value
code
index.html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Display Videos in an iframe</title>
  </head>
  <body>
    <h1>iframe Video Display</h1>
    <iframe
      width="560"
      height="315"
      src="https://www.youtube.com/embed/I0_951_MPE0"
      allow="accelerometer autoplay clipboard-write encrypted-media gyroscope web-share"
      referrerpolicy="strict-origin-when-cross-origin"
      allowfullscreen
    >
    </iframe> <!-- iframe element embeds a video file into the page. width and height attributes set the dimensions of the iframe. src attribute specifies the path to the video file. allow attribute specifies which features are allowed for the iframe content. referrerpolicy attribute controls how much referrer information is sent with requests made from the iframe. allowfullscreen attribute allows the iframe content to be displayed in fullscreen mode. -->
  </body>
</html>
preview
▸ rwd lab Build a Video Compilation Page html
Concepts LearnedReinforced Basic HTML
code
index.html
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <title>Video Compilation Page</title>
</head>

<body> <!-- sets the body of the document -->
<main> <!-- sets the main content area -->
<h1>Guerz's fCC video compilation</h1> <!-- main heading -->
<p>welcome to Guerz's page! enjoy the videos! ^_^</p> <!-- paragraph element provides a brief introduction to the page -->
<section> <!-- section element groups related content together -->
    <h2>first compilation</h2> <!-- heading for the first section -->
    <p>this is the first paragraph.</p>
    <iframe
      src="first-compilation.mp4"
      title="guerz's first"
      height="315"
      width="560">
    </iframe> <!-- iframe element embeds a video file into the page. src attribute specifies the path to the video file. title attribute provides a descriptive title for the iframe content. height and width attributes set the dimensions of the iframe. -->
</section>

<section>
    <h2>second compilation</h2>
    <p>this is the second paragraph.</p>
    <iframe
      src="second-compilation.ogg"
      title="guerz's second compilation"
      height="315"
      width="560">
    </iframe>
</section>

<section>
    <h2>third compilation</h2>
    <p>this is the third compilation.</p>
    <iframe
      src="third-compilation.webm"
      title="guerz's third compilation"
      height="315"
      width="560">
    </iframe>
</section>
</body>

</html>
preview
▸ HTML Semantic HTML 4 items · 4 built
▸ rwd workshop Build a List of Major Web Browsers html
Concepts Learneddl element • dt element • dd element • description lists
code
index.html
<!DOCTYPE html> 
<html lang="en"> 
  <head> 
    <meta charset="UTF-8"> 
    <meta name="viewport" content="width=device-width, initial-scale=1.0"> 
    <title>List of Browsers and Descriptions</title> 
  </head> 
  <body> 
    <h1>List of Major Web Browsers</h1> 
    <dl> <!-- dl element for defining a list of terms and their descriptions -->
      <dt>Google Chrome</dt> <!-- dt element for defining a term -->
      <dd>This is a free web browser developed by Google and first released in 2008.</dd> <!-- dd element for defining a description -->

      <dt>Firefox</dt> 
      <dd>This is a free web browser developed by the Mozilla Corporation and first created in 2004.</dd>

      <dt>Safari</dt>
      <dd>This browser was developed by Apple and is the default browser for iPhone, iPad and Mac devices.</dd>

      <dt>Brave</dt>
      <dd>This is a free web browser first released in 2016 that is based on the Chromium web browser.</dd>

      <dt>Arc</dt>
      <dd>This is a free Chromium-based web browser first released in 2023 by The Browser Company.</dd>    
    </dl>
  </body> 
</html>
preview
▸ rwd workshop Build Quincy’s Job Tips Page html
Concepts Learnedq element • blockquote element • cite attribute • cite element • &mdash; entity • main element • section element
code
index.html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Quincy's Tips for Getting a Developer Job</title>
  </head>
  <body>
    <h1>Quincy's Tips for Getting a Developer Job</h1>
    <p>
      Learning to code is hard, but as Quincy Larson says,
      <q cite="https://www.freecodecamp.org/news/learn-to-code-book/">You can become a developer.</q> <!-- q element for quoting a short inline quote -->
    </p>

    <main>
      <section>
        <h2>Envisioning Success</h2>
        <blockquote cite="https://www.freecodecamp.org/news/learn-to-code-book/"> <!-- blockquote element for quoting a longer passage. cite attribute provides a link to the source -->
          Can you imagine what it would be like to be a successful developer? To have built software systems that people rely upon?
        </blockquote>
        <p>
          &mdash;Quincy Larson, <cite>How to Learn to Code and Get a Developer Job [Full Book]</cite> <!-- cite element for citing a source. &mdash; is the em dash entity -->
        </p>
      </section>
      <section>
        <h2>Importance of Networking</h2>
        <blockquote cite="https://www.freecodecamp.org/news/learn-to-code-book/">
          <p>So much of getting a job is who you know.</p>
          <p>It's OK to be an introvert, but you do need to push your boundaries.</p>
          <p>Create GitHub, Twitter, LinkedIn, and Discord accounts.</p>
          <p>Go to tech meetups and conferences. Travel if you have to.</p>
        </blockquote>
      </section>
      <section>
        <h2>Importance of Building a Reputation</h2>
        <blockquote cite="https://www.freecodecamp.org/news/learn-to-code-book/">
          <p>Share short video demos of your projects.</p>
          <p>Keep applying to speak at bigger and bigger conferences.</p>
          <p>Hang out at hackerspaces and help people who are even newer to coding than you.</p>
        </blockquote>
      </section>
    </main>
  </body>
</html>
preview
▸ rwd workshop Build a Cat Blog Page html
Concepts Learnednav element • article element • address element • header element • footer element • tel: value • mailto: value • fragment links
code
index.html
<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Mr. Whiskers' Blog</title>
    <meta charset="UTF-8" />
  </head>
  <body>
    <header>
      <h1>Welcome to Mr. Whiskers' Blog Page!</h1>
      <figure>
        <img
          src="https://cdn.freecodecamp.org/curriculum/css-photo-gallery/1.jpg"
          alt="a cat in the garden"
        />
        <figcaption>Mr. Whiskers in the Garden</figcaption>
      </figure>
      <nav> <!-- nav element defines a navigation section -->
        <ul>
          <li><a href="#about">About</a></li>
          <li><a href="#posts">Posts</a></li>
          <li><a href="#contact">Contact</a></li>
        </ul>
      </nav>
    </header>
    <main>
      <section id="about">
        <h2>About</h2>
        <p>
          Hi there! I'm Jane Doe, a passionate writer who finds endless inspiration in the antics of my beloved cat, Mr. Whiskers.
        </p>
        <p>
          His playful nature and boundless energy keep me on my toes. I love him so much.
        </p>
      </section>
      <section id="posts">
        <h2>Posts</h2>
        <article> <!-- article element defines a self-contained piece of content -->
          <h3>Mr. Whiskers' First Day Home</h3>
          <p>
            Lorem ipsum dolor sit amet consectetur adipisicing elit. Quisquam
            quod, voluptates, quae, quos quibusdam dolorum quia nemo repudiandae
            quidem voluptatum quas. Quisquam quod, voluptates, quae, quos
            quibusdam dolorum quia nemo repudiandae quidem voluptatum quas.
          </p> <!-- Lorem ipsum defines placeholder text -->
          <p>
            Lorem ipsum dolor sit amet consectetur adipisicing elit. Quisquam
            quod, voluptates, quae, quos quibusdam dolorum quia nemo repudiandae
            quidem voluptatum quas. Quisquam quod, voluptates, quae, quos
            quibusdam dolorum quia nemo repudiandae quidem voluptatum quas.
          </p>
        </article>
        <article>
          <h3>Mr. Whiskers' First Bath</h3>
          <p>
            Lorem ipsum dolor sit amet consectetur adipisicing elit. Quisquam
            quod, voluptates, quae, quos quibusdam dolorum quia nemo repudiandae
            quidem voluptatum quas. Quisquam quod, voluptates, quae, quos
            quibusdam dolorum quia nemo repudiandae quidem voluptatum quas.
          </p>
          <p>
            Lorem ipsum dolor sit amet consectetur adipisicing elit. Quisquam
            quod, voluptates, quae, quos quibusdam dolorum quia nemo repudiandae
            quidem voluptatum quas. Quisquam quod, voluptates, quae, quos
            quibusdam dolorum quia nemo repudiandae quidem voluptatum quas.
          </p>
        </article>
        <article>
          <h3>Mr. Whiskers' First Birthday Party</h3>
          <p>
            Lorem ipsum dolor sit amet consectetur adipisicing elit. Quisquam
            quod, voluptates, quae, quos quibusdam dolorum quia nemo repudiandae
            quidem voluptatum quas. Quisquam quod, voluptates, quae, quos
            quibusdam dolorum quia nemo repudiandae quidem voluptatum quas.
          </p>
          <p>
            Lorem ipsum dolor sit amet consectetur adipisicing elit. Quisquam
            quod, voluptates, quae, quos quibusdam dolorum quia nemo repudiandae
            quidem voluptatum quas. Quisquam quod, voluptates, quae, quos
            quibusdam dolorum quia nemo repudiandae quidem voluptatum quas.
          </p>
        </article>
      </section>
    </main>
    <footer>
      <section id="contact">
        <h2>Contact</h2>
        <address> <!-- address element defines contact information -->
          <p>Phone: <a href="tel:5555555555">555-555-5555</a></p> <!-- tel: value allows users to call the number directly from their device -->
          <p>Email: <a href="mailto:fake@email.com">fake@email.com</a></p> <!-- mailto: value allows users to send an email directly from their device -->
        </address>
      </section>
    </footer>
  </body>
</html>
preview
▸ rwd lab Build an Event Hub html
Reinforces Learned Semantic HTML
code
index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Event Hub</title>
</head>
<body>
<header>
    <h1>Event Hub</h1>
    <nav>
        <ul>
            <li><a href="#upcoming-events">Upcoming Events</a></li>
            <li><a href="#past-events">Past Events</a></li>
        </ul>
    </nav>
</header>
<main>
    <section id="upcoming-events">
        <h2>Upcoming Events</h2>
        <article>
            <h3>{decompress}</h3>
            <p>June 9, 2027 - meditate to bass weight</p>
        </article>
        <article>
            <h3>{d} after hours</h3>
            <p>June 9, 2027 - for the stamina crewdem</p>
        </article>
    </section>
    <section id="past-events">
        <h2>Past Events</h2>
        <article>
            <h3>Pockets [Reunion Set - From Open to Whenever-You-Leave]</h3>
            <p>March 20, 2026 - Fern. Guerz. You're Welcome.</p>
            <img src="https://cdn.freecodecamp.org/curriculum/labs/past-event1.jpg" alt="Bedroom DJs all night long in your Pockets">
        </article>
        <article>
        <h3>Gathering Fine Wool</h3>
        <p>3 Guitars. 1 Drummer. No Bass. No Vocals. Eyes Down.</p>
        <img src="https://cdn.freecodecamp.org/curriculum/labs/past-event2.jpg" alt="Wonder.">
        </article>
    </section>
</main>
</body>
</html>
preview
▸ HTML Forms and Tables 4 items · 4 built
▸ rwd workshop Build a Hotel Feedback Form html
Concepts Learnedform element • method attribute • action attribute • fieldset element • legend element • label element • for attribute • input element • type attribute • placeholder attribute • required attribute • name attribute • size attribute • min & max attributes • checked attribute • value attribute • select element • option element • selected attribute • textarea element • rows & cols attributes • button element
code
index.html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>Hotel Feedback Form</title>
  </head>
  <body>
    <header>
      <h1>Hotel Feedback Form</h1>
      <p>
        Thank you for staying with us. Please provide feedback on your recent
        stay.
      </p>
    </header>
    <main>
      <form method="POST" action="https://hotel-feedback.freecodecamp.org">
        <fieldset> <!-- fieldset defines a group of related form elements -->
          <legend>Personal Information</legend> <!-- legend defines a caption for the fieldset -->
          <label for="full-name">Name (required):</label> <!-- label provides a text description for the input field -->
          <input type="text" id="full-name" name="name" placeholder="e.g., John Doe" required size="20"> <!-- input defines a field where the user can enter data. name attribute adds a name to the input field. placeholder attribute defines a hint about what to enter. required attribute makes the field mandatory. size attribute sets the width of the input field -->


          <label for="email">Email address (required):</label>
          <input
            placeholder="example@email.com"
            required
            id="email"
            type="email"
            name="email"
            size="20"
          />
          <label for="age">Age (optional):</label>
          <input type="number" name="age" id="age" min="3" max="100" /> <!--min and max attributes set the range of values for the input field -->
        </fieldset>

        <fieldset>
          <legend>Was this your first time at our hotel?</legend>
          <input id="yes-option" type="radio" name="hotel-stay" value="yes" /> <!-- radio value used when you want users to select one option from a list of options. in this example, the radio buttons are grouped together by using the same name attribute value. This means that only one radio button can be selected at a time. value attribute sets the value of the radio button. -->
          <label for="yes-option">Yes</label>
          <input id="no-option" type="radio" name="hotel-stay" value="no" />
          <label for="no-option">No</label>
        </fieldset>

        <fieldset>
          <legend>
            Why did you choose to stay at our hotel? (Check all that apply)
          </legend>

          <input type="checkbox" id="ads" name="choice" value="ads" /> <!-- checkbox defines a checkable box -->
          <label for="ads">Social Media Ads</label>

          <input
            type="checkbox"
            id="recommendation"
            name="choice"
            value="recommendation"
          />
          <label for="recommendation">Personal Recommendation</label>
          
          <input type="checkbox" id="location" name="choice" value="location" />
          <label for="location">Location</label>

          <input
            checked
            type="checkbox"
            id="reputation"
            name="choice"
            value="reputation"
          /> <!-- checked attribute pre-selects a checkbox -->
          <label for="reputation">Reputation</label>
          
          <input type="checkbox" id="price" name="choice" value="price" />
          <label for="price">Price</label>
        </fieldset>

        <fieldset>
          <legend>Ratings</legend>

          <label for="service">How was the service?</label>

          <select name="service" id="service"> <!-- select defines a drop-down list -->
            <option value="poor">Poor</option> <!-- option defines an option in a drop-down list. value attribute sets the value of the option -->
            <option value="satisfactory">Satisfactory</option>
            <option value="good">Good</option>
            <option value="very-good">Very Good</option>
            <option selected value="excellent">Excellent</option>
          </select>

          <label for="food">How was the food?</label>

          <select name="food" id="food">
            <option value="poor">Poor</option>
            <option value="satisfactory">Satisfactory</option>
            <option value="good">Good</option>
            <option value="very-good">Very Good</option>
            <option selected value="excellent">Excellent</option> <!-- selected attribute pre-selects an option -->
          </select>
        </fieldset>

        <label for="comments">Other Comments?</label>
        <textarea cols="30" rows="10" name="comments" id="comments"></textarea> <!-- textarea defines a multi-line text input field. cols and rows attributes set the dimensions of the text area -->

        <button type="submit">Submit</button>        
      </form>
    </main>
  </body>
</html>
preview
▸ rwd workshop Build a Final Exams Table html
Concepts Learnedtable element • caption element • thead element • tr element • th element • tbody element • td element • tfoot element • colspan attribute
code
index.html
<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Calculus Final Exams Table</title>
    <meta charset="UTF-8" />
  </head>
  <body>
    <table>
      <caption> <!-- caption element defines a caption for the table -->
        Calculus Final Exam Grades
      </caption>

      <thead> <!--thead element defines a set of rows that define the column headers of the table -->
        <tr> <!-- tr element defines a row of cells in the table -->
          <th>Last Name</th> <!-- th element defines a header cell in the table -->
          <th>First Name</th>
          <th>Grade</th>
        </tr>
      </thead>

      <tbody> <!-- tbody element defines a set of rows that define the main content of the table -->
        <tr>
          <td>Davis</td>
          <td>Alex</td>
          <td>54</td>
        </tr>

        <tr>
          <td>Doe</td>
          <td>Samantha</td>
          <td>92</td>
        </tr>

        <tr>
          <td>Rodriguez</td>
          <td>Marcus</td>
          <td>88</td>
        </tr>

        <tr>
          <td>Thompson</td>
          <td>Jane</td>
          <td>77</td>
        </tr>

        <tr>
          <td>Williams</td>
          <td>Natalie</td>
          <td>83</td>
        </tr>
      </tbody>

      <tfoot> <!-- tfoot defines a set of rows that define the footer of the table -->
        <tr>
          <td colspan="2">Average Grade</td> <!--colspan attribute defines the number of columns a cell should span -->
          <td>78.8</td>
        </tr>
      </tfoot>
    </table>
  </body>
</html>
preview
▸ rwd lab Build a Book Catalog Table html
Concepts LearnedReinforces Tables
code
index.html
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Book Catalog</title>
</head>

<body>
  <table>
    <thead>
      <tr>
        <th>Title</th>
        <th>Author</th>
        <th>Genre</th>
        <th>Publication Year</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td>Lullaby</td>
        <td>Chuck Palahniuk</td>
        <td>Dark Comedy/Transgressive Fiction</td>
        <td>2002</td>
      </tr>

      <tr>
        <td>Player Piano</td>
        <td>Kurt Vonnegut</td>
        <td>Social Satire/Dystopian Fiction</td>
        <td>1952</td>
      </tr>

      <tr>
        <td>What We Talk About When We Talk About Love</td>
        <td>Raymond Carver</td>
        <td>Dirty Realism/Minimalist Fiction</td>
        <td>1974</td>
      </tr>

      <tr>
        <td>Twelve</td>
        <td>Nick McDonell</td>
        <td>Bildungsroman/Urban Fiction</td>
        <td>2002</td>
      </tr>

      <tr>
        <td>The Rules of Attraction</td>
        <td>Bret Easton Ellis</td>
        <td>Black Comedy/Literary Fiction</td>
        <td>1978</td>
      </tr>
    </tbody>
    <tfoot>
      <tr>
        <td colspan="4">Total Books: 5</td>
      </tr>
    </tfoot>
  </table>
</body>
</html>
preview
▸ rwd cert project Build a Survey Form html
Concepts LearnedReinforces Forms
code
index.html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Survey Form</title>
</head>
<body>
  <div class="container">
    <h1 id="title">Guerz's Web Dev Bootcamp Survey</h1>
    
    <p id="description">Week 1 is done. Tell us how it's going.</p>
    <form id="survey-form">
      <label id="name-label" for="name">Name</label>
      <input id="name" type="text" placeholder="Enter your name" required/>

      <label id="email-label" for="email">Email</label>
      <input id="email" type="email" placeholder="Enter your email" required/>
      
      <label id="number-label" for="number">Age</label>
      <input id="number" type="number" min="10" max="120" placeholder="Enter your age"/>
      
      <label for="dropdown">How are you feeling about HTML so far?</label>
      <select id="dropdown">
        <option value="">Select one</option>
        <option value="confident">Confident</option>
        <option value="okay">Okay</option>
        <option value="lost">A bit lost</option>
      </select>
      
      <p>What's your current learning style?</p>
      <label>
        <input class="inline" type="radio" name="learning-style" value="visual"/>Visual (videos, diagrams)
      </label>

      <label>
        <input class="inline" type="radio" name="learning-style"value="hands-on"/>Hands-on (just build stuff)
      </label>
      
      <label>
        <input class="inline" type="radio" name="learning-style" value="reading"/>Reading docs
      </label>
      
      <p>Which topics have you covered? (check all that apply)</p>
      <label>
        <input class="inline" type="checkbox" value="html-basics"/>HTML Basics
      </label>
      
      <label>
        <input class="inline" type="checkbox" value="tables"/>Tables
      </label>
      
      <label>
        <input class="inline" type="checkbox" value="forms"/>Forms
      </label>
      
      <label>
        <input class="inline" type="checkbox" value="css"/>CSS
      </label>
      
      <label for="comments">Additional comments</label>
      <textarea id="comments" name="comments" rows="4" placeholder="Anything else you'd like to share?"></textarea>
      
      <button id="submit" type="submit">Submit</button>
    </form>
  </div>
</body>
</html>
preview
▸ HTML Accessibility 7 items · 7 built
▸ rwd workshop Debug a Coding Journey Blog Page html
Bug Fixes - Code Corrections Keeping Semantic HTMLLearned Concepts: POUR
Reinforced: nav element • main element • article element • footer element • heading hierarchy
code
index.html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Camperbot's Blog</title>
</head>
<body>
  <h1>Welcome to Camperbot's Blog</h1>

  <nav>
    <h2>Navigation</h2>
    <ul>
      <li><a href="#post1">My Journey</a></li>
      <li><a href="#post2">Accessibility</a></li>
      <li><a href="#post3">Next Steps</a></li>
    </ul>
  </nav>

  <main>
    <article>
      <h2 id="post1">My Journey Learning to Code</h2>
      <p>I started learning to code a few months ago and it's been a wild ride!</p>
      
      <h3>Early Challenges</h3>
      <p>At first, syntax was really confusing.</p>
      
      <h3>Breakthroughs</h3>
      <p>Eventually things started to click.</p>
    </article>

    <article>
      <h2 id="post2">Accessibility Matters</h2>
      <p>Today I learned that not everyone uses the web the same way I do.</p>

      <h3>Screen Readers</h3>
      <p>These tools help visually impaired users browse websites.</p>
    </article>

    <article>
      <h2 id="post3">What's Next?</h2>
      <p>I'm excited to dive into JavaScript and build interactive features!</p>

      <h3>Coming soon: My first JavaScript project!</h3>
      <p>Stay tuned for some exciting interactive blog features.</p>
    </article>
  </main>

  <footer>
    <h2>Contact Me</h2>
    <p>Email me at <a href="mailto:camperbot@blog.io">camperbot@blog.io</a></p>
  </footer>
</body>
</html>
preview
▸ rwd workshop Build a Tech Conference Schedule Table html
Concepts LearnedReinforced: Tables
code
index.html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Tech Conference 2025 Schedule</title>
</head>
<body>
  <h1>Tech Conference 2025 Schedule</h1>

  <table>
    <caption>Schedule by Track and Time</caption>

    <thead>
      <tr>
        <th scope="col">Time</th> <!-- scope attribute specifies whether a table header cell applies to a column, a row, or a group of columns or rows -->
        <th scope="col">Track A</th>
        <th scope="col">Track B</th>
        <th scope="col">Track C</th>
      </tr>
    </thead>

    <tbody>
      <tr>
        <th scope="row">9:00 AM</th>
        <td>Keynote: Tech Future</td>
        <td>Intro to Web Dev</td>
        <td>UX for All</td>
      </tr>

      <tr>
        <th scope="row">10:00 AM</th>
        <td>Accessibility Deep Dive</td>
        <td>CSS for Beginners</td>
        <td>Inclusive Design Principles</td>
      </tr>

      <tr>
        <th scope="row">11:00 AM</th>
        <td colspan="3">Break</td>
      </tr>

      <tr>
        <th scope="row">11:30 AM</th>
        <td>AR/VR in Education</td>
        <td>JavaScript Fundamentals</td>
        <td>Design Systems at Scale</td>
      </tr>

      <tr>
        <th scope="row">12:30 PM</th>
        <td colspan="3">Lunch Break</td>
      </tr>

      <tr>
        <th scope="row">2:00 PM</th>
        <td>Voice UI Workshop</td>
        <td>Git & GitHub Essentials</td>
        <td>Color & Contrast in UI</td>
      </tr>
    </tbody>
  </table>
</body>
</html>
preview
▸ rwd lab Debug a Donation Form html
Debug HTMLReinforces Forms
code
index.html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Donation Form</title>
</head>
<body>
  <h1>Donation Form</h1>
  <form>
    
    <label for="name">Full Name:</label>
    <input id="name" type="text" name="name" required>
    
    <label for="email">Email Address:</label>
    <input id="email" type="email" name="email" required>

    <label for="amount">Donation Amount ($):</label>
    <input id="amount" type="number" name="amount" required>

    <label for="newsletter">
    <input id="newsletter" type="checkbox" name="newsletter">
    Subscribe
    </label>

    <input type="submit" value="Send"> <!-- value attribute specifies the text to display on the submit button -->
  </form>
</body>
</html>
preview
▸ rwd workshop Build an Accessible Audio Controller html
Concepts Learnedspan element • input type="range" • multi-ID aria-labelledby values • aria-labelledby attribute
code
index.html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <title>Accessible Controls</title>
  </head>
  <body>

    <h1>Audio Controls</h1>

    <button type="button">Play</button>

    <div>
      <span id="volume-label">Volume</span>
      <span id="volume-description">Adjust the sound level</span> <!-- span element for descriptive text -->
      <input type="range" min="0" max="100" value="50" aria-labelledby="volume-label volume-description"> <!-- input element for volume control. type="range" is used for slider controls. min and max specify the range. value specifies the initial value. aria-labelledby links the input to its labels for accessibility -->
    </div>

    <button type="button">Mute</button>

  </body>
</html>
preview
▸ rwd lab Build a Checkout Page html
Concepts Learnedaria-hidden attribute • aria-describedby attribute
code
index.html
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <title>Checkout Page</title>
</head>

<body>
<h1>Checkout</h1>
<section>
<h2>Your Cart</h2>
<img src="https://cdn.freecodecamp.org/curriculum/labs/cube.jpg" alt="Rubik's Cube">
</section>

<section>
<h2>Payment Information</h2>
<form>
    <label for="card-name">
    <input id="card-name" name="card-name" type="text" required aria-hidden="true"> <!-- aria-hidden="true" indicates that the element and its children are not visible to accessibility tools, such as screen readers. This is useful for elements that are purely decorative or redundant, and do not provide any meaningful information to users who rely on assistive technologies. -->
    <span aria-hidden="true">*</span>
    </label>

    <label for="card-number">
    <input id="card-number" name="card-number" type="text" required aria-describedby="card-number-help"> <!-- aria-describedby attribute is used to associate the input field with a descriptive text element that provides additional information or instructions about the input. In this case, it links the input field with the paragraph element that has the id "card-number-help", which contains the text "Debit/Credit Card Number". This helps users understand what information is expected in the input field, especially for those using assistive technologies. -->
    <span aria-hidden="true">*</span> 
    </label>
    <p id="card-number-help">Debit/Credit Card Number + Expiration Date</p>
</form>
</section>
</body>

</html>
preview
▸ rwd lab Design a Movie Review Page html
Concepts LearnedReinforced: aria-hidden attribute
code
index.html
<!DOCTYPE html>
 <html lang="en">
 <head>
     <meta charset="UTF-8">
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
     <title>Movie Review</title>
 </head>

<body>
<main>
<h1>La science des rêves [The Science of Sleep]</h1>
<img src="https://upload.wikimedia.org/wikipedia/en/1/1e/Scienceofsleeppromo.jpg?utm_source=en.wikipedia.org&utm_campaign=imageinfo&utm_content=thumbnail_unscaled" alt="The Science of Sleep">
<p>In dreams emotions are overwhelming.</p>
<p><b>Movie Rating:</b><span aria-hidden="true">⭐⭐⭐⭐⭐⭐⭐⭐⭐☆</span> (9.6/10)</p> <!-- aria-hidden="true" indicates that the element and its children are not visible to accessibility tools, such as screen readers. This is useful for elements that are purely decorative or redundant, and do not provide any meaningful information to users who rely on assistive technologies. -->
<h2>Cast Members</h2>
<ul>
    <li><b>Gael García Bernal</b> as Stéphane</li>
    <li><b>Charlotte Gainsbourg</b> as Stéphanie</li>
</ul>
</main>
</body>

</html>
preview
▸ rwd lab Build a Multimedia Player html
Concepts Learnedaria-label attribute • kind attribute • srclang attribute
Reinforced: Multimedia Players
code
index.html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Multimedia Player</title>
</head>

<body>
<h1>Multimedia Player</h1>
<section>
  <h2>Now Playing: Sailing Away</h2>
  <audio controls aria-label="Music Player">
    <source src="https://cdn.freecodecamp.org/curriculum/js-music-player/sailing-away.mp3" type="audio/mpeg">
  </audio>
</section>

<section>
<h2>What is the Map Method and How Does It Work?</h2>
<video controls width="640" aria-label="Video Player"> <!--aria-label attribute provides a label for the video player for accessibility purposes -->
  <source src="https://cdn.freecodecamp.org/curriculum/labs/what-is-the-map-method-and-how-does-it-work.mp4" type="video/mp4">
  <track src="https://cdn.freecodecamp.org/curriculum/labs/what-is-the-map-method-and-how-does-it-work.vtt" kind="subtitles" srclang="en" label="English Subtitles"> <!-- track element is used to provide subtitles or captions for the video. src attribute specifies the URL of the subtitle file, kind attribute specifies the type of text track (subtitles in this case), srclang attribute specifies the language of the subtitles, and label attribute provides a label for the subtitles for accessibility purposes. -->
</video>

</section>

<section>
<h2>Transcript</h2>
<p>What is a map method and how does it work? The map method is a powerful and widely used function in JavaScript that operates on arrays. It's designed to create a new array by applying a given function to each element of the original array. This method does not modify the original array, but instead returns the new array containing the results of the function applied to each element.</p>
</section>
</body>

</html>
preview
▸ CSS Basic CSS 4 items · 4 built
▸ rwd workshop Design a Cafe Menu html + css
Learned ConceptsHTML — element terms: meta • style (not shown in code, used in workshop steps) • link • hr • address
attribute terms: content • href • rel • class • name
value terms: viewport • width-device-width • initial-scale=1.0 • styles.css • stylesheet
CSS — property terms: background-image • font-family • font-size • margin • margin-top • margin-right • margin-bottom • margin-left • font-style • text-align • width • max-width • height • background-color • border-color • padding • display
pseudo-class: a:visited • a:hover • a:active
keyword terms: Impact • serif • sans-serif • italic • inline-block • center • normal
other terms: url() function • px length
html
index.html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <!-- meta tag defines the viewport for responsive design. name="viewport" defines the viewport. content attribute specifies the width and initial scale. width=device-width ensures the page width matches the device width. initial-scale=1.0 sets the initial zoom level -->
    <title>Cafe Menu</title>
    <link href="styles.css" rel="stylesheet" /> <!-- styles defines the relationship between the HTML document and the external CSS file. href attribute specifies the path to the CSS file. rel attribute indicates that the linked file is a stylesheet. -->
  </head>
  <body>
    <div class="menu"> <!-- class attribute defines what class the element belongs to. -->
      <main>
        <h1>CAMPER CAFE</h1>
        <p class="established">Est. 2020</p>
        <hr> <!-- hr tag creates a horizontal line to separate content -->
        <section>
          <h2>Coffee</h2>
          <img src="https://cdn.freecodecamp.org/curriculum/css-cafe/coffee.jpg" alt="coffee icon"/>
          <article class="item">
            <p class="flavor">French Vanilla</p><p class="price">3.00</p>
          </article>
          <article class="item">
            <p class="flavor">Caramel Macchiato</p><p class="price">3.75</p>
          </article>
          <article class="item">
            <p class="flavor">Pumpkin Spice</p><p class="price">3.50</p>
          </article>
          <article class="item">
            <p class="flavor">Hazelnut</p><p class="price">4.00</p>
          </article>
          <article class="item">
            <p class="flavor">Mocha</p><p class="price">4.50</p>
          </article>
        </section>
        <section>
          <h2>Desserts</h2>
          <img src="https://cdn.freecodecamp.org/curriculum/css-cafe/pie.jpg" alt="pie icon"/>
          <article class="item">
            <p class="dessert">Donut</p><p class="price">1.50</p>
          </article>
          <article class="item">
            <p class="dessert">Cherry Pie</p><p class="price">2.75</p>
          </article>
          <article class="item">
            <p class="dessert">Cheesecake</p><p class="price">3.00</p>
          </article>
          <article class="item">
            <p class="dessert">Cinnamon Roll</p><p class="price">2.50</p>
          </article>
        </section>
      </main>
      <hr class="bottom-line">
      <footer>
        <address> <!-- address tag defines the contact information for the author or owner of the page -->
          <p>
            <a href="https://www.freecodecamp.org" target="_blank">Visit our website</a>
          </p>
          <p class="address">123 Free Code Camp Drive</p>
        </address>
      </footer>
    </div>
  </body>
</html>
css
styles.css
body {
  background-image: url(https://cdn.freecodecamp.org/curriculum/css-cafe/beans.jpg); /* background-image property sets the background image of the body element. url() function specifies the path to the image file. */
  font-family: sans-serif; /* font-family property sets the font family for the body element. sans-serif is a keyword that defines a generic sans-serif font. */
  padding: 20px; /* padding property adds space around the content of the body element. 20px value sets the padding to 20 pixels on all sides. */
}

h1 {
  font-size: 40px; /* font-size property sets the size of the font for the h1 element. 40px value sets the font size to 40 pixels. */
  margin-top: 0; /* margin-top property sets the top margin of the h1 element. 0 value removes any default top margin. */
  margin-bottom: 15px; /* margin-bottom property sets the bottom margin of the h1 element. 15px value adds a 15-pixel space below the h1 element. */
}

h2 {
  font-size: 30px;
}

.established {
  font-style: italic; /* font-style property sets the style of the font for the established class. italic value makes the text italicized. */
}

h1, h2, p {
  text-align: center; /* text-align property sets the horizontal alignment of the text for h1, h2, and p elements. center value centers the text horizontally within its container. */
}

.menu {
  width: 80%; /* width property sets the width of the menu class. 80% value makes the width 80% of the parent container's width. */
  background-color: burlywood; /* background-color property sets the background color of the menu class. burlywood is a named color that gives a light brown shade. */
  margin-left: auto; /* margin-left property sets the left margin of the menu class. auto value allows the browser to calculate the left margin automatically, centering the element horizontally. */
  margin-right: auto; /* margin-right property sets the right margin of the menu class. auto value allows the browser to calculate the right margin automatically, centering the element horizontally. */
  padding: 20px; /* padding property adds space around the content of the menu class. 20px value sets the padding to 20 pixels on all sides. */
  max-width: 500px; /* max-width property sets the maximum width of the menu class. 500px value ensures that the width does not exceed 500 pixels, even if the parent container is larger. */
}

img {
  display: block; /* display property sets the display behavior of the img element. block value makes the image a block-level element, allowing it to take up the full width available and start on a new line. */
  margin-left: auto; /* margin-left property sets the left margin of the img element. auto value allows the browser to calculate the left margin automatically, centering the image horizontally. */
  margin-right: auto; /* margin-right property sets the right margin of the img element. auto value allows the browser to calculate the right margin automatically, centering the image horizontally. */
  margin: -25px; /* margin property sets the margin of the img element. -25px value moves the image up by 25 pixels, creating a negative top margin. */
}

hr {
  height: 2px; /* height property sets the height of the hr element. 2px value makes the horizontal line 2 pixels tall. */
  background-color: brown; /* background-color property sets the background color of the hr element. brown is a named color that gives a dark brown shade. */
  border-color: brown; /* border-color property sets the color of the border of the hr element. brown value ensures that the border color matches t he background color, creating a consistent appearance. */
}

.bottom-line {
  margin-top: 25px;
}

h1, h2 {
  font-family: Impact, serif; <!-- font-family property sets the font family for h1 and h2 elements. Impact is a specific font, and serif is a generic font family that provides a fallback option if Impact is not available. -->
}

.item p {
  display: inline-block; <!-- display property sets the display behavior of the p element within the item class. inline-block value allows the paragraph to be displayed inline with other elements while still maintaining block-level properties, such as width and height. -->
  margin-top: 5px;
  margin-bottom: 5px;
  font-size: 18px;
}

.flavor, .dessert {
  text-align: left;
  width: 75%;
}

.price {
  text-align: right;
  width: 25%;
}

/* FOOTER */

footer {
  font-size: 14px;
}

address {
  font-style: normal;
}

.address {
  margin-bottom: 5px;
}

a {
  color: black;
}

a:visited { /* a:visited pseudo-class targets links that have been visited by the user. */
  color: black;
}

a:hover { /* a:hover pseudo-class targets links when the user hovers over them with the mouse pointer. */
  color: brown;
}

a:active { /* a:active pseudo-class targets links when they are being clicked or activated by the user. */
  color: brown;
}
preview
▸ rwd lab Design a Business Card html + css
Learned Conceptsmax-width • text-decoration
Reinforced: Basic CSS
html
index.html
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <title>Business Card</title>
    <link href="styles.css" rel="stylesheet" />                 
</head>

<body>
    <div class="business-card">
        <img class="profile-image" src="https://cdn.freecodecamp.org/curriculum/labs/flower.jpg" alt="Pink Flower">
        <p class="full-name">Nick Guerz</p>
        <p class="designation">Web Dev in Training</p>
        <p class="company">{decompress}</p>
    </div>
    <hr>
    <p>nick@guerz.lol</p>
    <p>845-675-8402</p>
    <a class="portfolio-link" href="https://guerz.lol">Portfolio</a>
    <a href="https://guerz.lol">guerz.lol</a>
    <hr>
    <div class="social-media">
        <h2>Connect with me</h2>
        <a href="https://x.com/notguerz">Twitter</a>
        <a href="https://www.linkedin.com/in/nicholas-guerzon-5baa77410/">LinkedIn</a>
        <a href="https://github.com/gitguerz">GitHub</a>
    </div>
</body>

</html>
css
styles.css
body {
  background: rosybrown;
  font-family: Arial, sans-serif;
}

.business-card {
  background-color: beige;
  width: 300px;
  padding: 20px;
  margin: 100px;
  text-align: center;
  font-size: 16px;
  margin-right: auto;
  margin-left: auto;
}

.profile-image {
  max-width: 100%; /* max-width is used to make the image responsive */
}

p {
  margin-top: 5px;
  margin-bottom: 5px;
}

a {
  text-decoration: none; /* text-decoration is used to remove the underline from the link */
}
preview
▸ rwd lab Build a Stylized To-Do List html + css
Learned Conceptsa tag selector • a:link selector • a:visited selector • a:hover selector • a:focus selector • a:active selector
html
index.html
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <link href="styles.css" rel="stylesheet">
    <title>Styled To-Do List</title>
</head>
<body>
    <ul class="todo-list">
        <li>
            <input type="checkbox" id="item1">
            <label for="item1">First Item</label>
            <ul class="sub-item">
                <li><a class="sub-item-link" href="https://example.org/one" target="_blank">First Link</a></li>
            </ul>
        </li>
        
        <li>
            <input type="checkbox" id="item2">
            <label for="item2">Second Item</label>
            <ul class="sub-item">
                <li><a class="sub-item-link" href="https://example.org/two" target="_blank">Second Link</a></li>
            </ul>
        </li>
        
        <li>
            <input type="checkbox" id="item3">
            <label for="item3">Third Item</label>
            <ul class="sub-item">
                <li><a class="sub-item-link" href="https://example.org/three" target="_blank">Third Link</a></li>
            </ul>
        </li>
        
        <li>
            <input type="checkbox" id="item4">
            <label for="item4">Fourth Item</label>
            <ul class="sub-item">
                <li><a class="sub-item-link" href="https://example.org/four" target="_blank">Fourth Link</a></li>
            </ul>
        </li>
    </ul>
</body>
</html>
css
styles.css
a { /* a tag selector is for links */
  text-decoration: none;
}

a:link { /* a:link selector is used to style unvisited links */
  color: #0ce213;
}

a:visited { /* a:visited selector is used to style visited links */
  color: #8e44ad;
}

a:hover { /* a:hover selector is used to style links when the user hovers over them */
  color: #f39c12;
}

a:focus { /* a:focus selector is used to style links when they are focused (e.g., clicked or tabbed to) */
  outline: 2px solid #c0392b;
}

a:active { /* a:active selector is used to style links when they are being clicked */
  color: #9063f0;
}
preview
▸ rwd lab Design a Blog Post Card html + css
Learned ConceptsIntroduced: border-radius property
Reinforced: Basic CSS
html
index.html
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Build an Event Flyer Page</title>
  <link rel="stylesheet" href="styles.css">
</head>

<body>
  <header><img src="https://cdn.freecodecamp.org/curriculum/labs/event.jpg">
  <h1>{decompress}</h1>
  </header>

  <main>
    <section>
      <h2><h2>))&lt;&gt;(( b2b Nein0hNein</h2> b2b Nein0hNein</h2>
    </section>
    <hr>
    <section>
      <h2>August 21st</h2>
    </section>
  </main>
</body>

</html>
css
styles.css
body { 
  padding-top: 50px;
  padding-bottom: 50px;
  margin: 0 auto;
  width: 90vw; /* 90vw is used to set the width of the body to 90% of the viewport width */
  min-height: calc(100vh - 100px); /* calc() function can run calculations. 100vh represents the full viewport height 100px represents the total padding and margin, because min-height is used to ensure the body is at least as tall as the viewport minus the padding and margin */
  background-color: #fdf6e3; font-family: sans-serif; text-align: center; 
  } 
  
header img { 
  width: 100%;
  border-radius: 15opx/* border-radius property is used to create rounded corners */
  8px; }

hr, section { 
   width: 80%;
   margin: 20px auto; 
} 

section { 
   padding: 10px; 
}
preview
▸ CSS Absolute and Relative Units 1 items · 1 built
▸ rwd lab Build an Event Flyer Page html + css
Learned ConceptsIntroduced: absolute units • relative units
Reinforced: px absolute unit • vw relative unit • vh relative unit • percentage relative unit • calc() function • auto value • min-height property • Basic HTML
html
index.html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Build an Event Flyer Page</title>
  <link rel="stylesheet" href="styles.css">
</head>

<body>
<header><img src="https://cdn.freecodecamp.org/curriculum/labs/event.jpg">
  <h1>{decompress} 8/20</h1>
</header>
<main>
    <section>
      <h2>{decompress}</h2>
    </section>
    <hr>
    <section>
      <h2>August 20th</h2>
    </section>
  </main>
</body>
</html>
css
styles.css
body {
  padding-top: 50px; /* px is an absolute unit, fixed, never scales with the viewport */
  padding-bottom: 50px;
  margin-top: 0; /* 0 is the one length that needs no unit (0px = 0% = 0) */
  margin-bottom: 0;
  margin-left: auto; /* auto eats leftover space evenly → centers the body */
  margin-right: auto;
  width: 60vw; /* vw is a relative unit, scales with the viewport. 1vw = 1% of the viewport width */
  min-height: calc(100vh - 100px); /* vh is a relative unit, scales with the viewport height. calc() mixes relative (100vh) + absolute (100px) to reserve top+bottom padding */
}

hr {
  width: 90%; /* 90% = relative to the parent's width */
}

section {
  width: 60%; /* 60% of the parent (body = 60vw), so it compounds to ~36vw. relative units nest */
}
preview
▸ CSS Pseudo Classes and Elements 3 items · 3 built
▸ rwd workshop Design a Greeting Card html + css
Learned ConceptsIntroduced: pseudo-classes • pseudo-elements • ::before pseudo-element • ::after pseudo-element • content property • :target pseudo-class • transition property • transform property • scale() function • skewX() function • box-shadow property • em relative unit
Reinforced: :hover pseudo-class • :active pseudo-class • :focus pseudo-class • :visited pseudo-class • outline property • border-radius property • max-width property • display: flex • justify-content property • space-around value • fragment links (#id)
html
index.html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Greeting Card</title>
    <link href="styles.css" rel="stylesheet">
  </head>
  <body>
    <div class="card" id="greeting-card">
      <h1>Happy Birthday!</h1>
      <p class="message">
        Wishing you all the happiness and joy on your special day!
      </p>
      <div class="card-links">
        <a href="#send" class="send-link">Send Card</a> <!-- This is a link that will navigate to the "send" section of the page -->
        <a href="#share" class="share-link">Share on Social Media</a> <!-- This is a link that will navigate to the "share" section of the page -->
      </div>
    </div>
    <section id="send"> <!-- This is a section with the id "send" that will be navigated to when the "Send Card" link is clicked -->
      <h2>Sending your card...</h2>
      <p>Card successfully sent to your recipient!</p>
    </section>
    <section id="share"> <!-- This is a section with the id "share" that will be navigated to when the "Share on Social Media" link is clicked -->
      <h2>Sharing your card...</h2>
      <p>Your card was shared on social media!</p>
    </section>
  </body>
</html>
css
styles.css
body {
  font-family: Arial, sans-serif;
  padding: 40px;
  text-align: center;
  background-color: brown;
}

.card {
  background-color: white;
  max-width: 400px;
  padding: 40px;
  margin: 0 auto;
  border-radius: 10px;
  box-shadow: 0 4px 8px gray;
  transition: transform 0.3s, background-color 0.3s ease; /* transition property for smooth transform and background color change. 0.3s is the duration of the transition. ease is the timing function */
}

.card:hover { /* .card:hover is a pseudo-class that applies styles when the card is hovered over */
  background-color: khaki;
  transform: scale(1.1);
}

h1::before { /* h1::before is a pseudo-element that adds content before the h1 element */
  content: "🥳 ";
}

h1::after { /* h1::after is a pseudo-element that adds content after the h1 element */
  content: " 🥳";
}

.message {
  font-size: 1.2em;
  margin-bottom: 20px;
}

.card-links {
  margin-top: 20px;
  display: flex;
  justify-content: space-around;
}

.card-links a {
  text-decoration: none;
  font-size: 1em;
  padding: 10px 20px;
  border-radius: 5px;
  color: white;
  background-color: midnightblue;
  transition: background-color 0.3s ease; /* transition property for smooth background color change. 0.3s is the duration of the transition. ease is the timing function */
}

.card-links a:hover { /* a hover creates a new state for the link */
  background-color: orangered; /* background color changes to orangered when hovered */
}

.card-links a:active { /* a active creates a new state for the link */
  background-color: midnightblue; /* background color changes to midnightblue when active */
}

.card-links a:focus { /* a focus creates a new state for the link */
  outline: 2px solid yellow; /* outline appears when the link is focused */
}

.card-links a:visited { /* a visited creates a new state for the link */
  color: crimson; /* color changes to crimson when the link has been visited */
}

section {
  margin: 20px auto;
  max-width: 600px;
  background-color: whitesmoke;
  padding: 20px;
  border-radius: 10px;
  display: none;  
}

section:hover { /* section hover creates a new state for the section */
  transform: skewX(10deg); /* transform changes section's orientation. skewX(10deg) changes the section's orientation 10 degrees */
}

section:target { /* section target creates a new state for the section */
  display: block; /* display changes to block when the section is targeted */
}
preview
▸ rwd workshop Design a Parent Teacher Conference Form html + css
Learned ConceptsIntroduced: :not() negation pseudo-class • :checked pseudo-class • appearance: none • translate() function • ::placeholder pseudo-element • 8-digit hex with alpha channel (#ffffff1a)
Reinforced: fieldset element • legend element • radio inputs with checked • ::before pseudo-element • content property • transition property • border-radius property • box-shadow property • rem relative unit
a parent-teacher conference scheduler — four fieldset groups over a translucent card. the interesting part is the contact-method radios: appearance: none wipes the native control, then a ::before dot scales in from zero on :checked, with :not() keeping the generic input rules off them.
html
index.html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Parent Teacher Conference Form</title>
    <link rel="stylesheet" href="./styles.css" />
  </head>
  <body>
  <main class="container">
    <h1 class="title center">Parent Teacher Conference Form</h1>
    <p class="description center">Please fill out the form below to help schedule your parent-teacher conference.</p>

    <form>
        <fieldset>
          <legend>Student Information</legend>
          <label for="student-name">Full Name: </label>
          <input
            type="text"
            name="student-name"
            id="student-name"
            required
            placeholder="E.g., Jane Doe"
          />

          <label for="grade">Student Grade: </label>
          <input
            type="number"
            name="grade"
            id="grade"
            required
            placeholder="E.g., 4"
          />
        </fieldset>
        
        <fieldset>
          <legend>Parent/Guardian Information</legend>
          <label for="parent-name">Parent/Guardian Name: </label>
          <input
            type="text"
            name="parent-name"
            id="parent-name"
            required
            placeholder="E.g., Nancy Doe"
          />
        </fieldset>

        <fieldset>
          <legend>Preferred Contact Method</legend>
          <label class="contact-method" for="email">Email: </label>
          <input
            id="email"
            class="contact-method-radio-btn"
            type="radio"
            name="contact-method"
            value="email"
            checked
          />

          <label class="contact-method" for="phone">Phone: </label>
          <input
            id="phone"
            class="contact-method-radio-btn"
            type="radio"
            name="contact-method"
            value="phone"
          />
        </fieldset>

        <fieldset>
          <legend>Additional Notes</legend>
          <label for="notes"
            >Any specific concerns or topics you'd like to discuss?</label
          >
          <textarea id="notes" name="notes" rows="4" cols="50"></textarea>
        </fieldset>

        <button class="submit-btn" type="submit">Submit Form</button>
      </form>
  </main>
  </body>
</html>
css
styles.css
body {
  background-color: MidnightBlue;
  color: whitesmoke;
}

.container {
    background-color: #ffffff1a; /* 8-digit hex: the last 2 digits (1a) are the alpha channel, making this white at roughly 10% opacity instead of solid */
    width: 80%;
    max-width: 600px;
    border-radius: 10px;
    margin: 20px auto;
    padding: 10px 20px;
    box-shadow: 0 5px 15px black;  
}

.center {
  text-align: center;
}

.description {
  font-size: 1.2rem;
}

fieldset {
  border: 1px solid gray;
  border-radius: 5px;
  margin: 20px 0;
  padding: 20px;
}

fieldset legend {
  font-size: 1.3rem;
  font-weight: 600;
}

label {
  font-size: 1.2rem;
}

label:not(.contact-method) { /* :not() is a negation pseudo-class — applies to every label EXCEPT ones carrying the contact-method class */
  display: block;
  margin: 10px 0;
}

input:not(.contact-method-radio-btn), /* :not() again excludes the custom radios, which get their own separate rule below */
textarea {
  background-color: #ffffff1a;
  width: 95%;
  border: 1px solid gray;
  border-radius: 5px;
  padding: 10px;
}

input,
input::placeholder, /* ::placeholder is a pseudo-element targeting the greyed hint text specifically, not the real typed value */
textarea {
  color: whitesmoke;
}


.contact-method-radio-btn {
  appearance: none; /* strips the browser's default radio styling entirely, giving a blank box to restyle from scratch */
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid gray;
  vertical-align: bottom;
}

.contact-method-radio-btn::before {
  display: block;
  content: " ";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transform: translate(3px, 3px) scale(0); /* translate() shifts the dot to visually center it inside the circle; scale(0) starts it invisible */
  transition: all 0.3s ease-in;
}

.contact-method-radio-btn:checked::before { /* :checked matches only while this specific radio is the selected one in its group */
  transform: translate(3px, 3px) scale(1);
  background-color: lightgreen;
}

.submit-btn {
  cursor: pointer;
  background-color: royalblue;
  color: whitesmoke;
  border: none;
  border-radius: 6px;
  padding: 12px 20px;
  font-size: 1.1rem;
  display: block;
  margin: auto;
}

.submit-btn:hover {
  background-color: midnightblue;
}
preview
▸ rwd lab Build a Job Application Form html + css
Learned ConceptsIntroduced: box-sizing: border-box • :invalid pseudo-class • :valid pseudo-class • :first-of-type pseudo-class • adjacent-sibling combinator (+) • rgba() function • resize property • flex-direction property
Reinforced: attribute selectors (input[type="..."]) • :focus pseudo-class • :hover pseudo-class • display: flex • border-radius property • box-shadow property • padding • margin
a job application form on a white card — name, email, a position select, an availability fieldset of radios, and a vertically-resizable textarea. fields border red or green live off :invalid / :valid, and the + combinator tints a radio's label the moment its input is checked.
html
index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Job Application Form</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="container">
<h1>Job Application Form</h1>
<form>
<label for="name">Full Name</label>
<input type="text" id="name" name="name" placeholder="Enter your full name" required>

<label for="email">Email Address</label>
<input type="email" id="email" name="email" placeholder="Enter your email" required>

<label for="position">Position Applying For</label>
<select id="position" name="position" required>
<option value="">Select a position</option>
<option value="developer">Developer</option>
<option value="designer">Designer</option>
<option value="manager">Project Manager</option>
</select>

<fieldset class="radio-group">
<legend>Availability</legend>
<input type="radio" id="full-time" name="availability" value="full-time" required>
<label for="full-time">Full-Time</label>

<input type="radio" id="part-time" name="availability" value="part-time" required>
<label for="part-time">Part-Time</label>
</fieldset>

<label for="message">Additional Message</label>
<textarea id="message" name="message" placeholder="Tell us about yourself"></textarea>

<button type="submit">Submit Application</button>
</form>
</div>
</body>
</html>
css
styles.css
* {
  box-sizing: border-box; /* padding and border are now included inside the declared width/height instead of adding to it */
}

body {
  font-family: Arial, sans-serif;
  background-color: #f0f2f5;
  margin: 0;
  padding: 20px;
}

.container {
  max-width: 500px;
  margin: 0 auto;
  background: #ffffff;
  padding: 24px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); /* rgba() sets color with an added alpha value for transparency — black at 10% opacity here */
}

h1 {
  text-align: center;
  color: #2c3e50;
}

form {
  display: flex;
  flex-direction: column;
}

label {
  margin-top: 14px;
  margin-bottom: 6px;
  font-weight: bold;
  color: #34495e;
}

input,
select,
textarea {
  padding: 10px;
  border: 2px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
}

input:first-of-type { /* :first-of-type is a structural pseudo-class matching only the first <input> among its siblings */
  border-radius: 20px;
}

input:focus,
textarea:focus {
  border-color: #3498db;
  outline: none;
}

input:invalid,
select:invalid,
textarea:invalid { /* :invalid is a native pseudo-class that auto-matches any field currently failing its own built-in validation — no JS needed */
  border-color: red;
}

input:valid,
select:valid,
textarea:valid { /* :valid is the inverse — matches fields currently passing validation */
  border-color: green;
}

textarea {
  min-height: 90px;
  resize: vertical; /* lets the user drag-resize the textarea vertically only; horizontal resize is disabled */
}

.radio-group {
  border: 1px solid #ccc;
  border-radius: 6px;
  margin-top: 14px;
  padding: 10px 14px;
}

.radio-group legend {
  font-weight: bold;
  color: #34495e;
}

.radio-group label {
  margin-left: 6px;
  margin-right: 20px;
  font-weight: normal;
  display: inline;
}

.radio-group input[type="radio"] { /* attribute selector — targets only inputs whose type attribute is exactly "radio" */
  width: 16px;
  height: 16px;
}

.radio-group input[type="radio"]:checked {
  border-color: #3498db;
  background-color: #3498db;
  box-shadow: 0 0 5px 1px rgba(52, 152, 219, 0.8);
}

.radio-group input[type="radio"]:checked + label { /* the + is an adjacent-sibling combinator — matches an element only when it comes immediately after the matched one in the markup */
  color: #3498db;
}

button {
  margin-top: 20px;
  padding: 12px;
  background-color: #3498db;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
}

button:hover {
  background-color: #2980b9;
}
preview
▸ CSS Colors 2 items · 2 built
▸ rwd workshop Build a Set of Colored Markers html + css
Learned ConceptsIntroduced: rgb color model • rgb() function • primary colors • secondary colors • tertiary colors • complementary colors • hexadecimal (hex) values • base 16 values • HSL (hue, saturation, lightness) color model • hsl() function • linear-gradient() function • gradientDirection value • color1 argument • color2 argument • color stops • img element • padding-top property • padding-bottom property • padding-left property • padding-right property • background property • offsetX value • offsetY value
three markers on a white strip — each one a cap plus a see-through rgba() sleeve, filled with a top-to-bottom linear-gradient() and lit by a soft box-shadow glow. same idea three ways: the red one is written in rgb(), the green in hex, the blue in hsl().
html
index.html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Colored Markers</title>
    <link rel="stylesheet" href="styles.css">
  </head>
  <body>
    <h1>CSS Color Markers</h1>
    <div class="container">
      <div class="marker red">
        <div class="cap"></div>
        <div class="sleeve"></div>
      </div>
      <div class="marker green">
        <div class="cap"></div>
        <div class="sleeve"></div>
      </div>
      <div class="marker blue">
        <div class="cap"></div>
        <div class="sleeve"></div>
      </div>
    </div>
  </body>
</html>
css
styles.css
h1 {
  text-align: center;
}

.container {
  background-color: rgb(255, 255, 255); /* rgb(red, green, blue), each 0-255; 255, 255, 255 is white */
  padding: 10px 0;
}

.marker {
  width: 200px;
  height: 25px;
  margin: 10px auto;
}

.cap {
  width: 60px;
  height: 25px;
}

.sleeve {
  width: 110px;
  height: 25px;
  background-color: rgba(255, 255, 255, 0.5); /* rgba adds a 4th value, alpha: 0 is invisible, 1 is solid, so 0.5 is half see-through */
  border-left: 10px double rgba(0, 0, 0, 0.75);
}

.cap, .sleeve {
  display: inline-block;
}

.red {
  background: linear-gradient(rgb(122, 74, 14), rgb(245, 62, 113), rgb(162, 27, 27)); /* linear-gradient() blends colors top to bottom by default; each color is a color stop. these stops are written as rgb() */
  box-shadow: 0 0 20px 0 rgba(83, 14, 14, 0.8); /* box-shadow: offsetX offsetY blur spread color. 0 offsets make an even glow instead of a drop shadow */
}

.green {
  background: linear-gradient(#55680D, #71F53E, #116C31); /* same gradient, color stops written as hex values */
  box-shadow: 0 0 20px 0 #3B7E20CC; /* 8-digit hex: the last two digits (CC) are the alpha, about 80% opaque */
}

.blue {
  background: linear-gradient(hsl(186, 76%, 16%), hsl(223, 90%, 60%), hsl(240, 56%, 42%)); /* color stops written as hsl(hue 0-360, saturation %, lightness %) */
  box-shadow: 0 0 20px 0 hsla(223, 59%, 31%, 0.8); /* hsla is hsl plus an alpha value */
}
preview
▸ rwd lab Design a Set of Colored Boxes html + css
Learned ConceptsIntroduced: hexadecimal (hex) values • base 16 values • rgb() function • hsl() function (hue, saturation, lightness) • hsla() function • alpha value • background-color property • width property • height property • class selector • multiple classes on one element • element selector • named colors (color keywords) • display: flex • flex-wrap property, wrap value • gap property
five 100px squares in a display: flex row that flex-wraps onto new lines when the screen gets narrow, spaced with gap. each box shows off a different way to write a color: hex, rgb(), a named color (tomato), hsl(), and a slightly see-through hsla().
html
index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Colored Boxes</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
  <div class="color-grid">
    <div class="color-box color1"></div> <!-- multiple classes on one element: color-box sets the size, color1 sets the color -->
    <div class="color-box color2"></div>
    <div class="color-box color3"></div>
    <div class="color-box color4"></div>
    <div class="color-box color5"></div>
  </div>
</body>
</html>
css
styles.css
body {
  background-color: #f4f4f4;
  }
  .color-grid {
  display: flex; /* display: flex makes this a flex container, so its children line up in a row */
  flex-wrap: wrap; /* wrap lets boxes drop to the next line when there is no room */
  gap: 10px; /* gap sets the space between flex items */
  }
  .color-box {
  width: 100px;
  height: 100px;
  }
  .color1 {
  background-color: #e63946; /* hex: red, green, blue as base-16 pairs (e6, 39, 46) */
  }
  .color2 {
  background-color: rgb(69, 123, 157); /* rgb(red, green, blue), each 0-255 */
  }
  .color3 {
  background-color: tomato; /* a named color (color keyword) */
  }
  .color4 {
  background-color: hsl(150, 60%, 45%); /* hsl(hue 0-360, saturation %, lightness %) */
  }
  .color5 {
  background-color: hsla(270, 70%, 55%, 0.8); /* hsla adds alpha: 0.8 is 80% opaque */
}
preview
▸ CSS Styling Forms 4 items · 4 built
▸ rwd workshop Build a Registration Form html + css
Learned ConceptsIntroduced: pattern attribute (regex [a-z0-5]{8,}) • type="password" • type="file" • min-width property • border-bottom property • :last-of-type pseudo-class • unset value
Reinforced: Forms
the fCC registration form — three fieldset groups (personal details, account type, optional profile), radios, a file picker, a number field with min/max, a select, a textarea, a pattern-validated password and a required terms checkbox. posts to the fCC demo endpoint.
html
index.html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Registration Form</title>
  <link rel="stylesheet" href="styles.css" />
</head>
<body>
  <h1>Registration Form</h1>
  <p>Please fill out this form with the required information</p>
  <form method="post" action='https://register-demo.freecodecamp.org'>
    <fieldset>
      <label for="first-name">Enter Your First Name: <input id="first-name" name="first-name" type="text" required /></label>
      <label for="last-name">Enter Your Last Name: <input id="last-name" name="last-name" type="text" required /></label>
      <label for="email">Enter Your Email: <input id="email" name="email" type="email" required /></label>
      <label for="new-password">Create a New Password: <input id="new-password" name="new-password" type="password" pattern="[a-z0-5]{8,}" required /></label> <!-- type="password" masks what is typed; pattern is a regex: 8 or more characters, only a-z and 0-5 -->
    </fieldset>
    <fieldset>
      <legend>Account type (required)</legend>
      <label for="personal-account"><input id="personal-account" type="radio" name="account-type" value="personal" class="inline" checked /> Personal</label>
      <label for="business-account"><input id="business-account" type="radio" name="account-type" value="business" class="inline" /> Business</label>
    </fieldset>
    <fieldset>
      <label for="profile-picture">Upload a profile picture: <input id="profile-picture" type="file" name="file" /></label> <!-- type="file" shows a file picker button -->
      <label for="age">Input your age (years): <input id="age" type="number" name="age" min="13" max="120" /></label>
      <label for="referrer">How did you hear about us?
        <select id="referrer" name="referrer">
          <option value="">(select one)</option>
          <option value="1">freeCodeCamp News</option>
          <option value="2">freeCodeCamp YouTube Channel</option>
          <option value="3">freeCodeCamp Forum</option>
          <option value="4">Other</option>
        </select>
      </label>
      <label for="bio">Provide a bio:
        <textarea id="bio" name="bio" rows="3" cols="30" placeholder="I like coding on the beach..."></textarea>
      </label>
    </fieldset>
    <a href="https://www.freecodecamp.org/news/terms-of-service">Read our terms and conditions</a>
    <label for="terms-and-conditions">
      <input class="inline" name="terms" id="terms-and-conditions" type="checkbox" required />
      I accept the terms and conditions
    </label>
    <input type="submit" value="Submit" />
  </form>
</body>
</html>
css
styles.css
body {
  width: 100%;
  height: 100vh;
  margin: 0;
  background-color: #1b1b32;
  color: #f5f6f7;
  font-family: Tahoma;
  font-size: 16px;
}

h1, p {
  margin: 1em auto;
  text-align: center;
}

form {
  width: 60vw;
  max-width: 500px;
  min-width: 300px; /* min-width stops the form from shrinking below 300px */
  margin: 0 auto;
  padding-bottom: 2em;
}

fieldset {
  border: none;
  padding: 2rem 0;
  border-bottom: 3px solid #3b3b4f; /* border-bottom adds a divider line under each group */
}

fieldset:last-of-type { /* :last-of-type matches only the last fieldset, so the final group gets no divider */
  border-bottom: none;
}

label {
  display: block;
  margin: 0.5rem 0;
}

input,
textarea,
select {
  margin: 10px 0 0 0;
  width: 100%;
  min-height: 2em;
}

input, textarea {
  background-color: #0a0a23;
  border: 1px solid #0a0a23;
  color: #ffffff;
}

.inline {
  width: unset; /* unset resets width to its default (auto), so the 100% from the input rule stops applying */
  margin: 0 0.5em 0 0;
  vertical-align: middle;
}

input[type="submit"] {
  display: block;
  width: 60%;
  margin: 1em auto;
  height: 2em;
  font-size: 1.1rem;
  background-color: #3b3b4f;
  border-color: white;
  min-width: 300px;
}

input[type="file"] {
  padding: 1px 2px;
}

a {
  color: #dfdfe2;
}
preview
▸ rwd lab Design a Contact Form html + css
Learned ConceptsIntroduced: :focus-visible pseudo-class • outline-offset property • font: inherit • autocomplete attribute
Reinforced: Forms • textarea • resize property • box-sizing • :hover pseudo-class
a dark contact form on a centered card: name, email and message fields with labels, a keyboard-only focus ring, and a button that changes color on hover.
html
index.html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Contact Form</title>
  <link rel="stylesheet" href="styles.css">
</head>
<body>
  <main>
    <div class="form-container">
      <form>
        <h2>Drop me a line</h2>
        <p>Got an idea? Let's hear it. All fields are required.</p>
        <label for="name">Name</label>
        <input type="text" id="name" name="name" autocomplete="name" required> <!-- autocomplete tells the browser which saved value to offer here (name, then email below) -->
        <label for="email">Email</label>
        <input type="email" id="email" name="email" autocomplete="email" required>
        <label for="message">Message</label>
        <textarea id="message" name="message" rows="5" required></textarea>
        <button type="submit">Submit</button>
      </form>
    </div>
  </main>
</body>
</html>
css
styles.css
* { 
  box-sizing: border-box; 
}

body { 
  margin: 0; 
  min-height: 100vh; 
  padding: 40px 16px; 
  background-color: #19151e; 
  color: #f7eef3; 
  font-family: system-ui, sans-serif; 
}

.form-container { 
  width: 100%; 
  max-width: 480px; 
  margin: auto; 
  background-color: #2b2232; 
  border: 1px solid #6c5678; 
  border-radius: 16px; 
  padding: 32px; 
}

h2 { 
  margin: 0 0 12px; 
  font-size: 2rem; 
}

p { 
  margin: 0 0 28px; 
  color: #d0c3d6; 
  line-height: 1.6; 
}

label { 
  display: block; 
  margin: 0 0 8px; 
  color: #ead7f5; 
  font-weight: 600; 
}

input, textarea { 
  width: 100%; 
  padding: 12px; 
  margin-bottom: 22px; 
  border: 2px solid #9f88ad; 
  border-radius: 6px; 
  background-color: #19151e; 
  color: #f7eef3; 
  font: inherit; /* font: inherit makes inputs and textareas use the page font, since form controls ignore it by default */
}

textarea { 
  resize: vertical; 
  min-height: 130px; 
}

input:focus-visible, 
textarea:focus-visible, 
button:focus-visible { /* :focus-visible shows this ring only when focus comes from the keyboard, not a mouse click */
  outline: 3px solid #e9b99e; 
  outline-offset: 3px; /* outline-offset pushes the ring 3px outside the element's edge */
}

button { 
  width: 100%; 
  padding: 13px 20px; 
  border: 0; 
  border-radius: 6px; 
  background-color: #e9b99e; 
  color: #211923; 
  font-size: 1.05rem; 
  font-weight: 700; 
  cursor: pointer; 
}

button:hover { 
  background-color: #d7b7ef; 
}
preview
▸ rwd workshop Build a Game Settings Panel html + css
Learned ConceptsIntroduced: text-align inheritance • line-height property
Reinforced: Forms • custom checkboxes
a game settings panel: four checkbox options on a centered card, each box restyled with appearance: none and a ✓ drawn in ::after when :checked.
html
index.html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Game Settings Panel</title>
    <link rel="stylesheet" href="styles.css" />
  </head>
  <body>
    <div class="settings-card">
      <h1>Game Settings</h1>
      <label> <input type="checkbox" />Sound Effects</label>
      <label> <input type="checkbox" />Background Music</label>
      <label> <input type="checkbox" />Hard Mode</label>
      <label> <input type="checkbox" />Haptic feedback</label>
    </div>
  </body>
</html>
css
styles.css
body {
  height: 100vh;
  background-color: #f0f0f0;
  text-align: center; /* text-align is inherited, so everything inside body is centered unless a child sets its own value */
}

.settings-card {
  max-width: 250px;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  margin: auto;
  text-align: left; /* overrides the centered text inherited from body, for this card only */
}

h1 {
  text-align: center;
}

label {
  display: block;
  cursor: pointer;
  margin: 8px auto;
}

input[type='checkbox'] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  appearance: none;
  border: 2px solid #f1be32;
  border-radius: 4px;
  background-color: white;
  transition: all 0.3s;
  vertical-align: middle;
  margin-right: 15px;
}

input[type='checkbox']:checked {
  background-color: #f1be32;
  border-color: #e2a60d;
}

input[type="checkbox"]:checked::after {
  content: "✓";
  display: block;
  text-align: center;
  font-weight: bold;
  color: white;
  line-height: 20px; /* line-height equal to the box height (20px) centers the checkmark vertically */
}
preview
▸ rwd lab Design a Feature Selection Page html + css
Learned ConceptsIntroduced: :has() relational pseudo-class • clamp() function • display: grid • repeat() function • auto-fit value • minmax() function • min() function • place-items property • flex-shrink property • :focus-visible pseudo-class • outline-offset property • letter-spacing property • line-height property • system-ui generic font family • small element
Reinforced: Forms • custom checkboxes • display: flex
a feature selection page: four selectable cards in a responsive grid. :has(input:checked) lights up the whole card when its checkbox is ticked, and :focus-visible keeps keyboard focus visible.
html
index.html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Feature Selection</title>
  <link rel="stylesheet" href="styles.css">
</head>
<body>
  <main>
    <p class="eyebrow">MAKE IT YOURS</p>
    <h1>Feature Selection</h1>
    <p class="intro">Choose the extras for your listening space.</p>
    <div class="feature-card-container">
      <!-- small is for side-comment text: a quieter sub-line under the strong title -->
      <label class="feature-card"><input type="checkbox" name="features" value="radio"><span><strong>Endless radio</strong><small>Keep the music flowing.</small></span></label>
      <label class="feature-card"><input type="checkbox" name="features" value="focus"><span><strong>Focus mode</strong><small>Less noise. More headspace.</small></span></label>
      <label class="feature-card"><input type="checkbox" name="features" value="discovery"><span><strong>Deep cuts</strong><small>Find your next favorite track.</small></span></label>
      <label class="feature-card"><input type="checkbox" name="features" value="offline"><span><strong>Offline listening</strong><small>Take your collection along.</small></span></label>
    </div>
    <p class="hint">Select any combination. Change it whenever.</p>
  </main>
</body>
</html>
css
styles.css
* { box-sizing: border-box; }
/* system-ui is a generic font family: it picks the operating system's own interface font */
body { margin: 0; min-height: 100vh; padding: 48px 20px; background: #19151e; color: #f7eef3; font-family: system-ui, sans-serif; }
main { max-width: 680px; margin: auto; }
/* letter-spacing adds space between every character */
.eyebrow { color: #d7b7ef; font-size: .75rem; font-weight: 700; letter-spacing: .18em; }
/* clamp(min, preferred, max): 7vw scales with the screen but is never smaller than 2rem or bigger than 3.5rem */
h1 { margin: 12px 0; font-size: clamp(2rem, 7vw, 3.5rem); line-height: 1.1; }
/* line-height sets the height of each line of text; a unitless 1.6 means 1.6 times the font size */
.intro { color: #c6bbc9; margin-bottom: 32px; line-height: 1.6; }
/* display: grid lays the cards out in a grid. repeat(auto-fit, ...) makes as many columns as fit; minmax(min(100%, 270px), 1fr) keeps each column between 270px (or the full width on tiny screens) and an equal share of the space */
.feature-card-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); gap: 16px; }
.feature-card { display: flex; align-items: center; gap: 16px; padding: 24px 20px; border: 2px solid #5d4c68; border-radius: 12px; background: #28202f; cursor: pointer; }
.feature-card:hover { border-color: #d7b7ef; }
/* :has() is a relational pseudo-class: it matches a .feature-card only when it contains a checked input, so the whole card can be styled */
.feature-card:has(input:checked) { background: #3d2c48; border-color: #d7b7ef; }
strong, small { display: block; }
strong { font-size: 1.05rem; }
small { margin-top: 7px; color: #c6bbc9; line-height: 1.5; }
/* flex-shrink: 0 stops the checkbox from being squeezed smaller in the flex row; place-items: center centers the checkmark inside the box (grid shorthand for align-items and justify-items) */
input[type="checkbox"] { appearance: none; width: 24px; height: 24px; flex-shrink: 0; margin: 0; border: 2px solid #bda2ce; border-radius: 5px; background-color: #19151e; display: grid; place-items: center; cursor: pointer; }
input[type="checkbox"]:checked { background-color: #e9b99e; border-color: #e9b99e; }
input[type="checkbox"]:checked::after { content: "✓"; display: block; text-align: center; color: #19151e; font-weight: bold; font-size: 18px; line-height: 20px; }
/* :focus-visible shows the outline only for keyboard focus, not mouse clicks; outline-offset pushes the outline 4px away from the edge */
input[type="checkbox"]:focus-visible { outline: 3px solid #f7eef3; outline-offset: 4px; }
.hint { margin-top: 24px; color: #c6bbc9; font-size: .85rem; line-height: 1.6; }
preview
▸ CSS Box Model 2 items · 2 built
▸ rwd workshop Design a Rothko Painting html + css
Learned ConceptsIntroduced: overflow property • filter: blur() • rotate() function
Reinforced: box-shadow • border-radius • transform • border • margin • padding • width and height
a Rothko-style painting built from nested divs: a thick black frame, a dark red canvas, and three softly blurred, slightly rotated color blocks.
html
index.html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <title>Rothko Painting</title>
    <link href="./styles.css" rel="stylesheet">
  </head>
  <body>
    <div class="frame">  <!-- outer frame: its thick border + padding make the painting's frame -->
      <div class="canvas">  <!-- canvas holds the three color blocks -->
        <div class="one"></div>
        <div class="two"></div>
        <div class="three"></div>
      </div>
    </div>
  </body>
</html>
css
styles.css
.canvas {
  width: 500px;
  height: 600px;
  background-color: #4d0f00;
  overflow: hidden;  /* clips anything that spills past the canvas edges */
  filter: blur(2px);  /* softens the whole canvas for a painted look */
}

.frame {
  border: 50px solid black;  /* border shorthand: width style color */
  width: 500px;
  padding: 50px;
  margin: 20px auto;
}

.one {
  width: 425px;
  height: 150px;
  background-color: #efb762;
  margin: 20px auto;
  box-shadow: 0 0 3px 3px #efb762;
  border-radius: 9px;
  transform: rotate(-0.6deg);  /* tiny tilt so the block looks hand-painted */
}

.two {
  width: 475px;
  height: 200px;
  background-color: #8f0401;
  margin: 0 auto 20px;  /* 3 values: top | left + right | bottom */
  box-shadow: 0 0 3px 3px #8f0401;
  border-radius: 8px 10px;
  transform: rotate(0.4deg);
}

.one, .two {
  filter: blur(1px);  /* shared blur for .one and .two */
}

.three {
  width: 91%;  /* percent = 91% of the parent (.canvas) */
  height: 28%;
  background-color: #b20403;
  margin: auto;
  filter: blur(2px);
  box-shadow: 0 0 5px 5px #b20403;
  border-radius: 30px 25px 60px 12px;
  transform: rotate(-0.2deg)
}
preview
▸ rwd lab Build a Confidential Email Page html + css
Learned ConceptsIntroduced: id selectors • border-style: double • currentColor keyword • monospace font stack • span element
Reinforced: filter: blur() • transform: rotate() • display: inline-block • letter-spacing • box-shadow • max-width • box-sizing
a confidential email on a dark page: a typewriter-font card, two tilted double-border stamps, and the secret details blurred out with a filter.
html
index.html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Confidential Email</title>
  <link rel="stylesheet" href="styles.css">
</head>
<body>
  <main id="email">  <!-- main = the page's one main content area; id lets CSS target it with #email -->
    <div id="confidential">CONFIDENTIAL</div>
    <h1>Operation Midnight Sloth</h1>
    <p>Agent Guerz, your next assignment begins at <span class="blurred">midnight</span>.</p>  <!-- span = inline wrapper, so only these words get blurred -->
    <p>Meet your contact at <span class="blurred">the abandoned record store</span>. Bring the lavender briefcase.</p>
    <p>The access phrase is <span class="blurred">prepared, Frederick</span>. Destroy this message after reading.</p>
    <div id="top-secret">TOP SECRET</div>
  </main>
</body>
</html>
css
styles.css
body {
  margin: 0;
  padding: 0 16px 40px;
  background: #242027;
  color: #302733;
  font-family: "Courier New", monospace;  /* typewriter look; monospace is the fallback */
}

#email {
  box-sizing: border-box;
  width: 500px;
  max-width: 100%;
  padding: 50px;
  margin: 50px auto 0;
  margin-top: 50px;
  border: 2px solid #9c789a;
  background: #f4e5d8;
  box-shadow: 10px 10px 0 #141116;
}

h1 {
  margin-top: 32px;
  font-size: 1.6rem;
  line-height: 1.2;
}

p {
  line-height: 1.7;
}

#confidential, #top-secret {  /* # = id selector; the comma styles both stamps */
  display: inline-block;  /* stamp stays inline but can take padding + transform */
  padding: 10px;
  margin-left: 10px;
  border: 3px double currentColor;  /* double = two-line border; currentColor reuses the text color */
  font-weight: bold;
  letter-spacing: 2px;
}

#confidential {
  color: #794766;
  transform: rotate(-7deg);  /* tilts the stamp */
}

#top-secret {
  margin-top: 20px;
  color: #944d3d;
  transform: rotate(6deg);
}

.blurred {
  filter: blur(3px);  /* blurs the secret words */
}
preview
▸ CSS Flexbox 4 items · 4 built
▸ rwd workshop Build a Flexbox Photo Gallery html + css
Learned ConceptsIntroduced: justify-content property • align-items property • object-fit property • text-transform property • universal selector (*)
Reinforced: display: flex • flex-direction • flex-wrap • gap • box-sizing: border-box • ::after pseudo-element • content property • max-width • border-radius
a flexbox photo gallery: nine cat photos in a wrapping, centered row under a dark header, each cropped to the same size with object-fit.
html
index.html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Photo Gallery</title>
    <link rel="stylesheet" href="./styles.css">
  </head>
  <body>
    <header class="header">
      <h1>css flexbox photo gallery</h1>
    </header>
    <div class="gallery">  <!-- flex container: the images inside become flex items -->
      <img src="https://cdn.freecodecamp.org/curriculum/css-photo-gallery/1.jpg" alt="cat-leaf">
      <img src="https://cdn.freecodecamp.org/curriculum/css-photo-gallery/2.jpg" alt="stretchy">
      <img src="https://cdn.freecodecamp.org/curriculum/css-photo-gallery/3.jpg" alt="looking-cat">
      <img src="https://cdn.freecodecamp.org/curriculum/css-photo-gallery/4.jpg" alt="cat-mlem">
      <img src="https://cdn.freecodecamp.org/curriculum/css-photo-gallery/5.jpg" alt="cat-basket">
      <img src="https://cdn.freecodecamp.org/curriculum/css-photo-gallery/6.jpg" alt="sleepy-cat">
      <img src="https://cdn.freecodecamp.org/curriculum/css-photo-gallery/7.jpg" alt="pale-cat">
      <img src="https://cdn.freecodecamp.org/curriculum/css-photo-gallery/8.jpg" alt="peak-a-cat">
      <img src="https://cdn.freecodecamp.org/curriculum/css-photo-gallery/9.jpg" alt="cat-derp">
    </div>
  </body>
</html>
css
styles.css
* {  /* * = universal selector, matches every element */
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: sans-serif;
  background: #f5f6f7;
}

.header {
  text-align: center;
  text-transform: uppercase;  /* shows the heading in all caps without retyping it */
  padding: 32px;
  background-color: #0a0a23;
  color: #fff;
  border-bottom: 4px solid #fdb347;
}

.gallery {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;  /* centers items along the main axis (left to right in a row) */
  align-items: center;  /* centers items along the cross axis (top to bottom in a row) */
  gap: 16px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 10px;
}

.gallery img {
  width: 100%;
  max-width: 350px;
  height: 300px;
  object-fit: cover;  /* crops the photo to fill its box instead of stretching it */
  border-radius: 10px;
}

.gallery::after {  /* empty 350px item at the end of the flex row, used as a spacer */
  content: "";
  width: 350px;
}
preview
▸ rwd workshop Design a Set of Colorful Boxes html + css
Learned ConceptsIntroduced: flex shorthand property • flex-grow property • flex-basis value • order property • align-content property • nested flex containers
Reinforced: display: flex • flex-direction: column • flex-wrap • flex-shrink property • align-items • margin: auto • border-radius
six colored boxes in a wrapping flex container, reordered with order and sized with grow and shrink so some boxes stretch and others squeeze.
html
index.html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Colored Boxes</title>
  <link rel="stylesheet" href="styles.css" />
</head>
<body>
  <header>
    <h1>Colored Boxes Layout</h1>
  </header>
  <div class="flex-container">  <!-- flex container: the six .box divs inside become flex items -->
    <div class="box box1">
      <h2>Box 1</h2>
      <p>Red</p>
    </div>
    <div class="box box2">
      <h2>Box 2</h2>
      <p>Orange</p>
    </div>
    <div class="box box3">
      <h2>Box 3</h2>
      <p>Yellow</p>
    </div>
    <div class="box box4">
      <h2>Box 4</h2>
      <p>Green</p>
    </div>
    <div class="box box5">
      <h2>Box 5</h2>
      <p>Blue</p>
    </div>
    <div class="box box6">
      <h2>Box 6</h2>
      <p>Indigo</p>
    </div>
  </div>
</body>
</html>
css
styles.css
h1 {
  text-align: center;
  margin-bottom: 10px;
}

.box {
  max-height: 120px;
  color: #000;
  border: 1px solid #000;
  display: flex;
  flex: 0 0 150px;  /* shorthand: flex-grow 0, flex-shrink 0, flex-basis 150px */
  flex-direction: column;
  align-items: center;
  margin: 10px;
  font-weight: bold;
  font-size: 1.125rem;
  border-radius: 5px;
  order: 0;  /* order sets visual position; lower numbers come first */
}

.flex-container {
  display: flex;
  flex-wrap: wrap;
  width: 70%;
  height: 600px;
  padding: 10px;
  margin: 20px auto;
  align-content: space-evenly;  /* spreads the wrapped rows evenly inside the container */
}

.box1 {
  background: #f16e79;
  order: 1; 
  flex-grow: 1;  /* this box grows to take up leftover space */
}

.box2 {
  background: #f4a261;
  order: 0; 
}

.box3 {
  background: #ffd166;
  order: 2;
  flex-shrink: 3;  /* this box shrinks 3x faster than the others */
}

.box4 {
  background: #4caf50;
  order: 3; 
}

.box5 {
  background: #457b9d;
  order: 4;
}

.box6 {
  background: #3f51b5;
  order: 5;
  flex-grow: 1;
}
preview
▸ rwd lab Design a Pricing Plans Layout Page html + css
Learned ConceptsIntroduced: justify-content: space-between value
Reinforced: flex shorthand property • flex-grow • order • flex-direction: column • flex-wrap • gap • min-height • padding • margin: auto
three pricing cards in a wrapping flex row; the Pro card grows wider and gets its own color, and each card spaces its title and price apart.
html
index.html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>Pricing Plans Layout Page</title>
    <link rel="stylesheet" href="styles.css" />
  </head>
  <body>
    <h1>Pricing Plans</h1>
    <div class="pricing-container">
    <div class="pricing-card basic-plan">
    <h2>Basic</h2>
    <p>$9/month</p>
    </div>
    <div class="pricing-card pro-plan">
    <h2>Pro</h2>
    <p>$19/month</p>
    </div>
    <div class="pricing-card premium-plan">
    <h2>Premium</h2>
    <p>$29/month</p>
    </div>
    </div>
  </body>
</html>
css
styles.css
body {
  font-family: Arial, sans-serif;
  background: #f5f0e8;
  padding: 24px;
}

h1 { text-align: center; }

.pricing-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  max-width: 960px;
  margin: 32px auto;
}

.pricing-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;  /* space-between pushes items to opposite ends (top and bottom here, since the direction is column) */
  flex: 0 0 200px;
  border: 2px solid black;
  padding: 20px;
  min-height: 180px;
  background: #e2d5ef;
}

.basic-plan { order: 0; }
.pro-plan {
  order: 1;
  flex-grow: 2;  /* only the Pro card grows to fill leftover space */
  background: #edc6ae;
}
.premium-plan { order: 2; }
preview
▸ rwd cert project Build a Page of Playing Cards html + css
Learned ConceptsIntroduced: align-self property • HTML character entities
Reinforced: nested flex containers • justify-content: space-between • flex-direction: column • flex-wrap • gap • transform: rotate() • descendant combinator • id selector • system-ui font family • box-sizing
three playing cards (A♠, 10♥, K♣) laid out with flexbox: corner symbols pinned with align-self, pips stacked in the middle, and the bottom corner rotated 180°.
html
index.html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Playing Cards</title>
    <link rel="stylesheet" href="styles.css" />
  </head>
  <body>
    <h1>Playing Cards</h1>
    <main id="playing-cards">
      <div class="card">
        <div class="left">A<br />&#9824;</div>  <!-- &#9824; = HTML character entity for the spade symbol -->
        <div class="middle">
          <span>&#9824;</span>
          <span>&#9824;</span>
          <span>&#9824;</span>
        </div>
        <div class="right">A<br />&#9824;</div>
      </div>
      <div class="card red">
        <div class="left">10<br />&#9829;</div>
        <div class="middle">
          <span>&#9829;</span>
          <span>&#9829;</span>
          <span>&#9829;</span>
        </div>
        <div class="right">10<br />&#9829;</div>
      </div>
      <div class="card">
        <div class="left">K<br />&#9827;</div>
        <div class="middle">
          <span>&#9827;</span>
          <span>&#9827;</span>
          <span>&#9827;</span>
        </div>
        <div class="right">K<br />&#9827;</div>
      </div>
    </main>
  </body>
</html>
css
styles.css
body {
  font-family: system-ui, sans-serif;
  background-color: #1a2a4a;
  color: #111;
  margin: 0;
  padding: 20px;
}

h1 {
  text-align: center;
  color: #fff;
  margin-bottom: 20px;
}

#playing-cards {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
}

.card {
  display: flex;
  justify-content: space-between;
  flex-direction: column;
  width: 150px;
  height: 220px;
  background-color: #fff;
  border: 2px solid #333;
  border-radius: 10px;
  padding: 10px;
  box-sizing: border-box;
  font-size: 1rem;
  font-weight: bold;
}

.left {
  align-self: flex-start;  /* overrides align-items for just this one item */
}

.middle {  /* also a flex container: flexbox nested inside a flex item */
  align-self: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  font-size: 1.5rem;
  text-align: center;
}

.right {
  align-self: flex-end;
  transform: rotate(180deg);  /* flips the bottom-right corner upside down, like a real card */
}

.red .left,  /* descendant selector (.left inside .red); the commas group three selectors */
.red .middle,
.red .right {
  color: #cc0000;
}
preview
▸ CSS Typography 2 items · 2 built
▸ rwd workshop Build a Nutritional Label html + css
Learned ConceptsIntroduced: font-weight property • text-indent property • negative margin values • Google Fonts link element
Reinforced: font-family • font stack • rem unit • em unit • letter-spacing • display: flex • justify-content • align-items • :not() pseudo-class • border-bottom • descendant combinator • box-sizing
a recreation of a nutrition facts label: Open Sans in several weights, thick and thin divider lines, and flexbox rows that push each nutrient to the left and its daily value to the right.
html
index.html
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>Nutrition Label</title>
  <link href="https://fonts.googleapis.com/css?family=Open+Sans:400,700,800" rel="stylesheet">  <!-- loads the Open Sans font from Google Fonts in weights 400, 700 and 800 -->
  <link href="./styles.css" rel="stylesheet">
</head>

<body>
  <div class="label">
    <header>
      <h1 class="bold">Nutrition Facts</h1>
      <div class="divider"></div>
      <p>8 servings per container</p>
      <p class="bold">Serving size <span>2/3 cup (55g)</span></p>
    </header>
    <div class="divider large"></div>
    <div class="calories-info">
      <div class="left-container">
        <h2 class="bold small-text">Amount per serving</h2>
        <p>Calories</p>
      </div>
      <span>230</span>
    </div>
    <div class="divider medium"></div>
    <div class="daily-value small-text">
      <p class="bold right no-divider">% Daily Value *</p>
      <div class="divider"></div>
      <p><span><span class="bold">Total Fat</span> 8g</span> <span class="bold">10%</span></p>
      <p class="indent no-divider">Saturated Fat 1g <span class="bold">5%</span></p>
      <div class="divider"></div>
      <p class="indent no-divider"><span><i>Trans</i> Fat 0g</span></p>
      <div class="divider"></div>
      <p><span><span class="bold">Cholesterol</span> 0mg</span> <span class="bold">0%</span></p>
      <p><span><span class="bold">Sodium</span> 160mg</span> <span class="bold">7%</span></p>
      <p><span><span class="bold">Total Carbohydrate</span> 37g</span> <span class="bold">13%</span></p>
      <p class="indent no-divider">Dietary Fiber 4g</p>
      <div class="divider"></div>
      <p class="indent no-divider">Total Sugars 12g</p>
      <div class="divider double-indent"></div>
      <p class="double-indent no-divider">Includes 10g Added Sugars <span class="bold">20%</span></p>
      <div class="divider"></div>
      <p class="no-divider"><span><span class="bold">Protein</span> 3g</span></p>
      <div class="divider large"></div>
      <p>Vitamin D 2mcg <span>10%</span></p>
      <p>Calcium 260mg <span>20%</span></p>
      <p>Iron 8mg <span>45%</span></p>
      <p class="no-divider">Potassium 235mg <span>6%</span></p>
    </div>
    <div class="divider medium"></div>
    <p class="note">* The % Daily Value (DV) tells you how much a nutrient in a serving of food contributes to a daily
      diet. 2,000 calories a day is used for general nutrition advice.</p>
  </div>
</body>
</html>
css
styles.css
* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  font-family: 'Open Sans', sans-serif;
}

.label {
  border: 2px solid black;
  width: 270px;
  margin: 20px auto;
  padding: 0 7px;
}

header h1 {
  text-align: center;
  margin: -4px 0;  /* negative margin pulls the heading closer to its neighbors */
  letter-spacing: 0.15px
}

p {
  margin: 0;
  display: flex;
  justify-content: space-between;
}

.divider {
  border-bottom: 1px solid #888989;
  margin: 2px 0;
}

.bold {
  font-weight: 800;  /* 800 = extra bold; numeric weights run from 100 to 900 */
}

.large {
  height: 10px;
}

.large, .medium {
  background-color: black;
  border: 0;
}

.medium {
  height: 5px;
}

.small-text {
  font-size: 0.85rem;
}


.calories-info {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.calories-info h2 {
  margin: 0;
}

.left-container p {
  margin: -5px -2px;
  font-size: 2em;
  font-weight: 700;
}

.calories-info span {
  margin: -7px -2px;
  font-size: 2.4em;
  font-weight: 700;
}

.right {
  justify-content: flex-end;
}

.indent {
  margin-left: 1em;
}

.double-indent {
  margin-left: 2em;
}

.daily-value p:not(.no-divider) {
  border-bottom: 1px solid #888989;
}

.note {
  font-size: 0.6rem;
  margin: 5px 0;
  padding: 0 8px;
  text-indent: -8px;  /* negative indent pulls the first line left, so the * hangs outside the text */
}
preview
▸ rwd lab Build a Newspaper Article html + css
Learned ConceptsIntroduced: ::first-letter pseudo-element • media queries (@media with max-width) • border-block shorthand • overflow-wrap property
Reinforced: font-weight • font-size • font-style • text-transform • text-indent • letter-spacing • line-height • text-align • border-style: double • box-shadow • max-width • box-sizing
a newspaper article, "The Daily Side-Eye", styled mostly with typography: a double-ruled masthead, uppercase byline, italic sub-headline, an enlarged first letter, and a media query for small screens.
html
index.html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>The Daily Side-Eye</title>
  <link rel="stylesheet" href="styles.css">
</head>
<body>
  <main class="newspaper">
    <p class="name">The Daily Side-Eye</p>
    <p class="date">November 1, 2026 · All the news fit to procrastinate with</p>
    <h1 class="headline">Local Developer Opens 47 Tabs, Calls It Research</h1>
    <p class="sub-headline">One missing semicolon. Three cold coffees. Absolutely no suspects.</p>
    <p class="author">By Guerz · Chief Procrastination Correspondent</p>
    <p class="text">Witnesses report that a local developer sat down to fix one tiny CSS issue and resurfaced four hours later with a new color palette, strong opinions about fonts, and the original problem completely untouched. “I am building a workflow,” the developer explained, opening an eighth tutorial on productivity. The workflow could not be reached for comment.</p>
    <p class="text">The breakthrough arrived when the developer discovered that the stylesheet was never linked. Experts described the incident as “deeply avoidable” and “basically Tuesday.” A nearby rubber duck has requested a raise. At press time, the page finally looked correct, prompting the developer to celebrate by changing everything.</p>
    <p class="edition">Independent journalism. Questionable time management. · Price: one working stylesheet.</p>
  </main>
</body>
</html>
css
styles.css
html { 
   font-size: 24px; 
}

* { 
   box-sizing: border-box; 
}

body { 
   margin: 0; 
   padding: 28px 16px; 
   background: #29232e; 
   color: #29232e; 
}

.newspaper { 
   font-size: 16px; 
   font-family: 'Open Sans', sans-serif; 
   max-width: 800px; 
   margin: auto; 
   padding: 32px; 
   background: #f7efdf; 
   border-top: 8px solid #ac6252; 
   box-shadow: 8px 8px 0 #161219; 
}

.name { 
   font-size: 2rem; 
   font-family: 'Times New Roman', serif; 
   text-transform: uppercase; 
   text-align: center; 
   margin: 0; 
   padding-bottom: 18px; 
   border-bottom: 5px double #29232e; 
   letter-spacing: -2px; 
}

.date { 
   text-align: center; 
   padding-bottom: 16px; 
   border-bottom: 1px solid #29232e; 
}

.headline { 
   font-size: 2em; 
   font-weight: bold; 
   margin-bottom: 12px; 
   line-height: 1.15; 
}

.sub-headline { 
   font-weight: 100; 
   font-size: 1.5em; 
   font-style: italic; 
   color: #784735; 
   margin-top: 0; 
}

.author { 
   font-weight: bold; 
   text-transform: uppercase; 
   border-block: 1px solid #29232e;  /* border-block = top and bottom borders in one line */
   padding: 12px 0; 
   letter-spacing: 1px; 
}

.text { 
   text-indent: 20px;  /* indents only the first line of each paragraph */
   line-height: 2em; 
}

.text::first-letter {  /* ::first-letter styles just the first letter of the paragraph */
   font-weight: bold; 
   font-size: 2em; 
   color: #784735; 
}

.edition { 
   border-top: 5px double #29232e; 
   padding-top: 16px; 
   font-size: 12px; 
   text-align: center; 
}

@media (max-width: 480px) {  /* media query: these rules only apply on screens 480px wide or narrower */
   .newspaper { 
      padding: 20px; 
   } 
   .name { 
      letter-spacing: -1px; 
      overflow-wrap: anywhere;  /* lets long words break so they don't overflow on small screens */
   } 
}
preview
▸ CSS Accessibility 2 items · 2 built
▸ rwd workshop Build a Quiz Webpage html + css
Learned ConceptsIntroduced: prefers-reduced-motion media feature • scroll-behavior property • aspect-ratio property • max() function • position: absolute • sr-only (visually hidden) technique • clip property • list-style property • logical properties (padding-inline-start, margin-block) • role and aria-labelledby attributes
Reinforced: min() function • vw unit • child combinator (>) • :hover pseudo-class • ::before pseudo-element • content property • fieldset and legend • label for attribute • select and textarea • address element • display: flex
an accessible quiz page: a header with anchor-link navigation, a form with labeled inputs, fieldsets, a select and a textarea, screen-reader-only question text, and smooth scrolling that respects reduced-motion settings.
html
index.html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="freeCodeCamp Accessibility Quiz practice project" />
    <title>Accessibility Quiz</title>
    <link rel="stylesheet" href="styles.css" />
  </head>
  <body>
    <header>
      <img id="logo" alt="freeCodeCamp" src="https://cdn.freecodecamp.org/platform/universal/fcc_primary.svg">
      <h1>HTML/CSS Quiz</h1>
      <nav>
        <ul>
          <li><a href="#student-info">INFO</a></li>
          <li><a href="#html-questions">HTML</a></li>
          <li><a href="#css-questions">CSS</a></li>
        </ul>
      </nav>
    </header>
    <main>
      <form method="post" action="https://freecodecamp.org/practice-project/accessibility-quiz">
        <section role="region" aria-labelledby="student-info">  <!-- role + aria-labelledby name this section for screen readers, using the h2 below -->
          <h2 id="student-info">Student Info</h2>
          <div class="info">
            <label for="student-name">Name:</label>
            <input type="text" name="student-name" id="student-name" />
          </div>
          <div class="info">
            <label for="student-email">Email:</label>
            <input type="email" name="student-email" id="student-email" />
          </div>
          <div class="info">
            <label for="birth-date">Date of Birth:</label>
            <input type="date" name="birth-date" id="birth-date" />
          </div>
        </section>
        <section role="region" aria-labelledby="html-questions">
          <h2 id="html-questions">HTML</h2>
          <div class="question-block">
            <h3><span class="sr-only">Question</span>1</h3>  <!-- sr-only text is hidden visually but still read by screen readers -->
            <fieldset class="question" name="html-question-one">
              <legend>
                The legend element represents a caption for the content of its
                parent fieldset element
              </legend>
              <ul class="answers-list">
                <li>
                  <label for="q1-a1">
                    <input type="radio" id="q1-a1" name="q1" value="true" />
                    True
                  </label>
                </li>
                <li>
                  <label for="q1-a2">
                    <input type="radio" id="q1-a2" name="q1" value="false" />
                    False
                  </label>
                </li>
              </ul>
            </fieldset>
          </div>
          <div class="question-block">
            <h3><span class="sr-only">Question</span>2</h3>
            <fieldset class="question" name="html-question-two">
              <legend>
                A label element nesting an input element is required to have a
                for attribute with the same value as the input's id
              </legend>
              <ul class="answers-list">
                <li>
                  <label for="q2-a1">
                    <input type="radio" id="q2-a1" name="q2" value="true" />
                    True
                  </label>
                </li>
                <li>
                  <label for="q2-a2">
                    <input type="radio" id="q2-a2" name="q2" value="false" />
                    False
                  </label>
                </li>
              </ul>
            </fieldset>
          </div>
        </section>
        <section role="region" aria-labelledby="css-questions">
          <h2 id="css-questions">CSS</h2>
          <div class="formrow">
            <div class="question-block">
              <label for="selector">Can the CSS margin property accept negative values?</label>
            </div>
            <div class="answer">
              <select name="selector" id="selector" required>
                <option value="">Select an option</option>
                <option value="yes">Yes</option>
                <option value="no">No</option>
              </select>
            </div>
            <div class="question-block">
              <label for="css-textarea">Do you have any questions:</label>
            </div>
            <div class="answer">
              <textarea id="css-textarea" name="css-questions" rows="5" cols="24"></textarea>
            </div>
          </div>
        </section>
        <button type="submit">Send</button>
      </form>
    </main>
    <footer>
      <address>
        <a href="https://freecodecamp.org">freeCodeCamp</a><br />
        San Francisco<br />
        California<br />
        USA
      </address>
    </footer>
  </body>
</html>
css
styles.css
@media (prefers-reduced-motion: no-preference) {  /* only animate scrolling for people who haven't asked their system to reduce motion */
  * {
    scroll-behavior: smooth;  /* anchor-link jumps glide instead of snapping */
  }
}

body {
  background: #f5f6f7;
  color: #1b1b32;
  font-family: Helvetica;
  margin: 0;
}

header {
  width: 100%;
  height: 50px;
  background-color: #1b1b32;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#logo {
  width: max(10rem, 18vw);  /* max() picks the larger of the two values */
  background-color: #0a0a23;
  aspect-ratio: 35 / 4;  /* keeps the logo's width-to-height shape as it scales */
  padding: 0.4rem;
}

h1 {
  color: #f1be32;
  font-size: min(5vw, 1.2em);
  text-align: center;
}

nav {
  width: 50%;
  max-width: 300px;
  height: 50px;
}

nav > ul {
  display: flex;
  justify-content: space-evenly;
  flex-wrap: wrap;
  align-items: center;
  padding-inline-start: 0;  /* logical property: padding on the start side of the text direction (left in English) */
  margin-block: 0;
  height: 100%;
}

nav > ul > li {
  color: #dfdfe2;
  margin: 0 0.2rem;
  padding: 0.2rem;
  display: block;
}

nav > ul > li:hover {
  background-color: #dfdfe2;
  color: #1b1b32;
  cursor: pointer;
}

li > a {
  color: inherit;
  text-decoration: none;
}

main {
  padding-top: 50px;
}

section {
  width: 80%;
  margin: 0 auto 10px auto;
  max-width: 600px;
}

h1,
h2 {
  font-family: Verdana, Tahoma;
}

h2 {
  border-bottom: 4px solid #dfdfe2;
  margin-top: 0px;
  padding-top: 60px;
}

.info {
  padding: 10px 0 0 5px;
}

.formrow {
  margin-top: 30px;
  padding: 0px 15px;
}

input {
  font-size: 1rem;
}

.info label, .info input {
  display: inline-block;
}

.info input {
  width: 50%;
  text-align: left;
}

.info label {
  width: 10%;
  min-width: 55px;
  text-align: right;
}

.question-block {
  text-align: left;
  display: block;
  width: 100%;
  margin-top: 20px;
  padding-top: 5px;
}

h3 {
  margin-top: 5px;
  padding-left: 15px;
  font-size: 1.375rem;
}

h3::before {
  content: "Question #";
}

.question {
  border: none;
  padding-bottom: 0;
}

.answers-list {
  list-style: none;  /* removes the bullet markers */
  padding: 0;
}

button {
  display: block;
  margin: 40px auto;
  width: 40%;
  padding: 15px;
  font-size: 1.438rem;
  background: #d0d0d5;
  border: 3px solid #3b3b4f;
}

footer {
  background-color: #2a2a40;
  display: flex;
  justify-content: center;
}

footer,
footer a {
  color: #dfdfe2;
}

address {
  text-align: center;
  padding: 0.3em;
}

.sr-only {  /* visually hidden, but still read aloud by screen readers */
  position: absolute;  /* takes the element out of the page flow so it takes up no space */
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);  /* clips the element down to nothing so it can't be seen */
  white-space: nowrap;
}
  border: 0;
preview
▸ rwd lab Build a Tribute Page html + css
Learned ConceptsIntroduced: figure and figcaption elements • text-underline-offset property • ch unit • height: auto with max-width: 100% (responsive image)
Reinforced: id selectors • clamp() function • media queries • :focus-visible pseudo-class • outline-offset property • :hover pseudo-class • line-height • border-radius • max-width • box-sizing • font-family
a tribute page for Chris: a centered card with a photo and caption, three short paragraphs and a link, using the id selectors the project calls for and a visible keyboard focus ring.
html
index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>For Chris</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<main id="main">
  <h1 id="title">Chris</h1>
  <figure id="img-div">  <!-- figure wraps the image and its caption as one unit -->
    <img id="image" src="cris-fern.jpg" alt="a photo of Chris">
    <figcaption id="img-caption">Chris — music in his ears, a cat in his lap.</figcaption>  <!-- figcaption = the caption for the figure -->
  </figure>
  <section id="tribute-info">
    <p>Chris loved music the way few people do — not as background noise, but as a whole language.</p>
    <p>He loved cats just as fiercely — quiet, stubborn, loyal. it's why they still show up in everything I build.</p>
    <p>And he loved me. he believed in this before I did. every set and every line of code carries a little of him.</p>
  </section>
  <a id="tribute-link" href="https://twitch.tv/guerz" target="_blank">the music keeps going — {decompress}</a>
</main>
</body>
</html>
css
styles.css
* { 
   box-sizing: border-box; 
}
body { 
   margin: 0; 
   padding: 32px 16px; 
   background: #211e26; 
   color: #eee5df; 
   font-family: Georgia, serif; 
   line-height: 1.8; 
}

#main { 
   max-width: 760px; 
   margin: 0 auto; 
   padding: 32px; 
   background: #302b35; 
   border-top: 4px solid #c3999d; 
}

#title { 
   margin: 0 0 24px; 
   color: #dec1b2; 
   font-size: clamp(2.5rem, 8vw, 4rem); 
   text-align: center; 
}

#img-div { 
   margin: 0; 
}

#image { 
   display: block; 
   max-width: 100%; 
   height: auto;  /* keeps the image's proportions when max-width shrinks it */
   margin: 0 auto; 
   border-radius: 3px; 
}

#img-caption { 
   margin-top: 16px; 
   text-align: center; 
   color: #c8b9cd; 
   font-style: italic; 
}

#tribute-info { 
   margin: 32px auto; 
   max-width: 60ch;  /* ch = width of the 0 character, so this is roughly 60 characters per line */
}

#tribute-link { 
   display: block; 
   text-align: center; 
   color: #edbfa9; 
   text-underline-offset: 5px;  /* moves the underline 5px away from the text */
}

#tribute-link:hover { 
   color: #fff; 
}

#tribute-link:focus-visible { 
   outline: 2px solid #edbfa9; 
   outline-offset: 6px; 
}

@media (max-width: 480px) { 
   #main { 
      padding: 20px; 
   } 
}
preview
▸ CSS Positioning 2 items · 2 built
▸ rwd workshop Build a Cat Painting html + css
Learned ConceptsIntroduced: top, right, bottom and left offset properties • z-index property • CSS shapes made with borders (border triangles) • elliptical border-radius (slash syntax) • border-color with four values • transparent keyword
Reinforced: position: absolute • linear-gradient() function • transform: rotate() • border-radius • margin: auto • box-sizing • width and height • background-color
a cat's face painted entirely in CSS: ears made from border triangles, eyes, nose, mouth curves and whiskers, all absolutely positioned inside the head.
html
index.html
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>fCC Cat Painting</title>
    <link rel="stylesheet" href="./styles.css">
</head>
<body>
    <main>
      <div class="cat-head">  <!-- every cat part is nested in .cat-head, so the absolutely positioned pieces line up to the head -->
        <div class="cat-ears">
          <div class="cat-left-ear">
            <div class="cat-left-inner-ear"></div>
          </div>
          <div class="cat-right-ear">
            <div class="cat-right-inner-ear"></div>
          </div>
        </div>

        <div class="cat-eyes">
          <div class="cat-left-eye">
            <div class="cat-left-inner-eye"></div>
          </div>
          <div class="cat-right-eye">
            <div class="cat-right-inner-eye"></div>
          </div>
        </div>
        
        <div class="cat-nose"></div>

        <div class="cat-mouth">
          <div class="cat-mouth-line-left"></div>
          <div class="cat-mouth-line-right"></div>
        </div>

        <div class="cat-whiskers">
          <div class="cat-whiskers-left">
            <div class="cat-whisker-left-top"></div>
            <div class="cat-whisker-left-middle"></div>
            <div class="cat-whisker-left-bottom"></div>
          </div>
          <div class="cat-whiskers-right">
            <div class="cat-whisker-right-top"></div>
            <div class="cat-whisker-right-middle"></div>
            <div class="cat-whisker-right-bottom"></div>
          </div>
        </div>

      </div>
    </main>
</body>
</html>
css
styles.css
* {
  box-sizing: border-box;
}

body {
  background-color: #c9d2fc;
}

.cat-head {
  position: absolute;  /* takes the head out of normal flow so top, right, bottom and left can place it */
  right: 0;
  left: 0;
  top: 0;
  bottom: 0;
  margin: auto;  /* with top, right, bottom and left all 0, auto margins center the head both ways */
  background: linear-gradient(#5e5e5e 85%, #45454f 100%);
  width: 205px;
  height: 180px;
  border: 1px solid #000;
  border-radius: 46%;
}

.cat-left-ear {
  position: absolute;
  top: -26px;
  left: -31px;
  z-index: 1;  /* z-index controls stacking: higher numbers sit on top */
  border-top-left-radius: 90px;
  border-top-right-radius: 10px;
  transform: rotate(-45deg);
  border-left: 35px solid transparent;  /* transparent side borders + a colored bottom border = a triangle (the ear) */
  border-right: 35px solid transparent;
  border-bottom: 70px solid #5e5e5e;  /* the colored bottom border is the visible part of the triangle */
}

.cat-right-ear {
  position: absolute;
  top: -26px;
  left: 163px;
  z-index: 1;
  transform: rotate(45deg);
  border-top-left-radius: 90px;
  border-top-right-radius: 10px;
  border-left: 35px solid transparent;
  border-right: 35px solid transparent;
  border-bottom: 70px solid #5e5e5e;
}

.cat-left-inner-ear {
  position: absolute;
  top: 22px;
  left: -20px;
  border-top-left-radius: 90px;
  border-top-right-radius: 10px;
  border-bottom-right-radius: 40%;
  border-bottom-left-radius: 40%;
  border-left: 20px solid transparent;
  border-right: 20px solid transparent;
  border-bottom: 40px solid #3b3b4f;
}

.cat-right-inner-ear {
  position: absolute;
  top: 22px;
  left: -20px;
  border-top-left-radius: 90px;
  border-top-right-radius: 10px;
  border-bottom-right-radius: 40%;
  border-bottom-left-radius: 40%;
  border-left: 20px solid transparent;
  border-right: 20px solid transparent;
  border-bottom: 40px solid #3b3b4f;
}

.cat-left-eye {
  position: absolute;
  top: 54px;
  left: 39px;
  border-radius: 60%;
  transform: rotate(25deg);
  width: 30px;
  height: 40px;
  background-color: #000;
}

.cat-right-eye {
  position: absolute;
  top: 54px;
  left: 134px;
  border-radius: 60%;
  transform: rotate(-25deg);
  width: 30px;
  height: 40px;
  background-color: #000;
}

.cat-left-inner-eye {
  position: absolute;
  top: 8px;
  left: 2px;
  width: 10px;
  height: 20px;
  transform: rotate(10deg);
  background-color: #fff;
  border-radius: 60%;
}

.cat-right-inner-eye {
  position: absolute;
  top: 8px;
  left: 18px;
  transform: rotate(-5deg);
  width: 10px;
  height: 20px;
  background-color: #fff;
  border-radius: 60%;
}

.cat-nose {
  position: absolute;
  top: 108px;
  left: 85px;
  border-top-left-radius: 50%;
  border-bottom-right-radius: 50%;
  border-bottom-left-radius: 50%;
  transform: rotate(180deg);
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
  border-bottom: 20px solid #442c2c;
}

.cat-mouth div {
  width: 30px;
  height: 50px;
  border: 2px solid #000;
  border-radius: 190%/190px 150px 0 0;  /* slash = horizontal radii / vertical radii, which makes elliptical curves */
  border-color: black transparent transparent transparent;  /* four values go top, right, bottom, left: only the top border shows, giving a curved line */
}

.cat-mouth-line-left {
  position: absolute;
  top: 88px;
  left: 74px;
  transform: rotate(170deg);
}

.cat-mouth-line-right {
  position: absolute;
  top: 88px;
  left: 91px;
  transform: rotate(165deg);
}

.cat-whiskers-left div {
  width: 40px;
  height: 1px;
  background-color: #000;
}

.cat-whiskers-right div {
  width: 40px;
  height: 1px;
  background-color: #000;
}

.cat-whisker-left-top {
  position: absolute;
  top: 120px;
  left: 52px;
  transform: rotate(10deg);
}

.cat-whisker-left-middle {
  position: absolute;
  top: 127px;
  left: 52px;
  transform: rotate(3deg);
}

.cat-whisker-left-bottom {
  position: absolute;
  top: 134px;
  left: 52px;
  transform: rotate(-3deg);
}

.cat-whisker-right-top {
  position: absolute;
  top: 120px;
  left: 109px;
  transform: rotate(-10deg);
}

.cat-whisker-right-middle {
  position: absolute;
  top: 127px;
  left: 109px;
  transform: rotate(-3deg);
}

.cat-whisker-right-bottom {
  position: absolute;
  top: 134px;
  left: 109px;
  transform: rotate(3deg);  
}
preview
▸ rwd lab Build a House Painting html + css
Learned ConceptsIntroduced: position: relative • repeating-linear-gradient() function • isolation property • negative z-index • hard color stops • aria-label attribute
Reinforced: position: absolute • top, right, bottom and left offsets • z-index • ::before and ::after pseudo-elements • content property • calc() function • child combinator (>) • id selectors • box-shadow • border-radius • linear-gradient() function • box-sizing
a night-time cottage painted in CSS: brick-striped walls, a chimney, glowing windows with ::before and ::after crossbars, and a door, all positioned inside one relative parent.
html
index.html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>The Midnight Cottage</title>
  <link rel="stylesheet" href="styles.css">
</head>
<body>
  <h1>The Midnight Cottage</h1>
  <p>lights on. world off.</p>
  <div id="house" role="img" aria-label="A peach cottage with a lavender roof, chimney, two glowing windows, and a purple door beneath a night sky.">  <!-- role="img" + aria-label: tells screen readers this CSS drawing is one image, and describes it -->
    <div id="chimney"></div>
    <div id="roof"></div>
    <div id="window-1"></div>
    <div id="window-2"></div>
    <div id="door"></div>
  </div>
</body>
</html>
css
styles.css
* { 
   box-sizing: border-box; 
}

body { 
   margin: 0; 
   padding: 36px 20px 80px; 
   min-height: 100vh; 
   background: linear-gradient(#191625 70%, #363447 70%);  /* both stops at 70% = a hard edge between the sky and the ground */
   color: #efd3c2; 
   font-family: Georgia, serif; 
   text-align: center; 
   isolation: isolate;  /* gives the page its own stacking context, so the chimney's z-index: -1 can't slip behind the body background */
}

h1 { 
   font-size: 2.2rem; 
   margin-bottom: 0; 
}

p { 
   color: #b8a7c9; 
   letter-spacing: 3px; 
   margin-bottom: 100px; 
}

#house { 
   position: relative;  /* makes #house the positioning parent for its absolutely placed pieces */
   width: 500px; 
   height: 400px; 
   border: 6px solid #302333; 
   background-color: #bb8473; 
   margin: 0 auto; 
   background-image: repeating-linear-gradient(0deg, transparent 0 29px, #a77265 29px 31px);  /* repeating-linear-gradient repeats the stripe: 29px clear, then a 2px line, over and over */
   box-shadow: 0 18px 0 #1c1925; 
}

#house > div { 
   position: absolute; 
}

#chimney { 
   width: 64px; 
   height: 110px; 
   border: 5px solid #302333; 
   background-color: #8d697b; 
   top: -110px; 
   right: 65px; 
   z-index: -1;  /* a negative z-index puts the chimney behind the house */
   background-image: repeating-linear-gradient(0deg, transparent 0 22px, #302333 22px 26px); 
}

#roof { 
   width: 488px; height: 105px; 
   border: 5px solid #302333; 
   background-color: #6d597e; 
   top: 0; 
   left: 0; 
   border-radius: 80px 80px 0 0; 
   background-image: repeating-linear-gradient(0deg, transparent 0 22px, #564461 22px 25px); 
}

#window-1, #window-2 { 
   width: 100px; 
   height: 100px; 
   border: 7px solid #302333; 
   background-color: #f4ca86; 
   top: 150px; 
   box-shadow: 0 0 24px #efbe7c55; 
}

#window-1 { 
   left: 40px; 
}

#window-2 { 
   right: 40px; 
}

#window-1::before, 
#window-2::before { 
   content: ''; 
   position: absolute; 
   width: 6px; 
   height: 100%; 
   left: calc(50% - 3px);  /* calc() does the math: halfway across, minus half the bar's width, centers the bar */
   background: #302333; 
}

#window-1::after, 
#window-2::after { 
   content: ''; position: 
   absolute; height: 
   6px; width: 100%; 
   top: calc(50% - 3px); 
   left: 0; 
   background: #302333; 
}

#door { 
   width: 100px; 
   height: 160px; 
   border: 6px solid #302333; 
   background-color: #625075; 
   bottom: 0; left: 194px; 
   border-radius: 45px 45px 0 0; 
}

#door::after { 
   content: ''; 
   position: absolute; 
   width: 10px; 
   height: 10px; 
   border-radius: 50%; 
   background: #f4ca86; 
   right: 12px; 
   top: 85px; 
}
preview
▸ CSS Attribute Selectors 2 items · 2 built
▸ rwd workshop Build a Balance Sheet html + css
Learned ConceptsIntroduced: !important declaration • position: sticky • clip-path property • border-collapse property • :nth-of-type() pseudo-class • vertical-align property • aria-hidden attribute
Reinforced: attribute selectors ([class~="..."], [class="..."]) • descendant combinator • sr-only technique • clip property • calc() function • :hover pseudo-class • linear-gradient() function • border-style: double • display: flex • gap • Tables • caption • rem unit
an accessible balance sheet: three tables (assets, liabilities, net worth) with a sticky year header, screen-reader-only labels, and attribute selectors like [class~="sr-only"] doing the styling.
html
index.html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Balance Sheet</title>
    <link rel="stylesheet" href="./styles.css" />
  </head>
  <body>
    <main>
      <section>
        <h1>
          <span class="flex">
            <span>AcmeWidgetCorp</span>
            <span>Balance Sheet</span>
          </span>
        </h1>
        <div id="years" aria-hidden="true">  <!-- aria-hidden hides this visual-only year row from screen readers; the table headers already announce the years -->
          <span class="year">2019</span>
          <span class="year">2020</span>
          <span class="year">2021</span>
        </div>
        <div class="table-wrap">
          <table>
            <caption>  <!-- caption gives the table a title that screen readers announce -->
              Assets
            </caption>
            <thead>
              <tr>
                <td></td>
                <th><span class="sr-only year">2019</span></th>
                <th><span class="sr-only year">2020</span></th>
                <th class="current"><span class="sr-only year">2021</span></th>
              </tr>
            </thead>
            <tbody>
              <tr class="data">
                <th>Cash <span class="description">This is the cash we currently have on hand.</span></th>
                <td>$25</td>
                <td>$30</td>
                <td class="current">$28</td>
              </tr>
              <tr class="data">
                <th>Checking <span class="description">Our primary transactional account.</span></th>
                <td>$54</td>
                <td>$56</td>
                <td class="current">$53</td>
              </tr>
              <tr class="data">
                <th>Savings <span class="description">Funds set aside for emergencies.</span></th>
                <td>$500</td>
                <td>$650</td>
                <td class="current">$728</td>
              </tr>
              <tr class="total">
                <th>Total <span class="sr-only">Assets</span></th>
                <td>$579</td>
                <td>$736</td>
                <td class="current">$809</td>
              </tr>
            </tbody>
          </table>
          <table>
            <caption>
              Liabilities
            </caption>
            <thead>
              <tr>
                <td></td>
                <th><span class="sr-only">2019</span></th>
                <th><span class="sr-only">2020</span></th>
                <th><span class="sr-only">2021</span></th>
              </tr>
            </thead>
            <tbody>
              <tr class="data">
                <th>Loans <span class="description">The outstanding balance on our startup loan.</span></th>
                <td>$500</td>
                <td>$250</td>
                <td class="current">$0</td>
              </tr>
              <tr class="data">
                <th>Expenses <span class="description">Annual anticipated expenses, such as payroll.</span></th>
                <td>$200</td>
                <td>$300</td>
                <td class="current">$400</td>
              </tr>
              <tr class="data">
                <th>Credit <span class="description">The outstanding balance on our credit card.</span></th>
                <td>$50</td>
                <td>$50</td>
                <td class="current">$75</td>
              </tr>
              <tr class="total">
                <th>Total <span class="sr-only">Liabilities</span></th>
                <td>$750</td>
                <td>$600</td>
                <td class="current">$475</td>
              </tr>
            </tbody>
          </table>
          <table>
            <caption>
              Net Worth
            </caption>
            <thead>
              <tr>
                <td></td>
                <th><span class="sr-only">2019</span></th>
                <th><span class="sr-only">2020</span></th>
                <th><span class="sr-only">2021</span></th>
              </tr>
            </thead>
            <tbody>
              <tr class="total">
                <th>Total <span class="sr-only">Net Worth</span></th>
                <td>$-171</td>
                <td>$136</td>
                <td class="current">$334</td>
              </tr>
            </tbody>
          </table>
        </div>
      </section>
    </main>
  </body>
</html>
css
styles.css
span[class~="sr-only"] {
  border: 0 !important;  /* !important beats any other rule for this property, whatever the specificity */
  clip: rect(1px, 1px, 1px, 1px) !important;
  clip-path: inset(50%) !important;  /* clips the element down to nothing so it can't be seen */
  height: 1px !important;
  width: 1px !important;
  position: absolute !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  padding: 0 !important;
  margin: -1px !important;
}

html {
  box-sizing: border-box;
}

body {
  font-family: sans-serif;
  color: #0a0a23;
}

h1 {
  max-width: 37.25rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
}

h1 .flex {
  display: flex;
  flex-direction: column-reverse;
  gap: 1rem;
}

h1 .flex span:first-of-type {
  font-size: 0.7em;
}

h1 .flex span:last-of-type {
  font-size: 1.2em;
}

section {
  max-width: 40rem;
  margin: 0 auto;
  border: 2px solid #d0d0d5;
}

#years {
  display: flex;
  justify-content: flex-end;
  position: sticky;  /* sticks the year row to the top of the screen while you scroll */
  z-index: 999;
  top: 0;
  background: #0a0a23;
  color: #fff;
  padding: 0.5rem calc(1.25rem + 2px) 0.5rem 0;
  margin: 0 -2px;
}

#years span[class] {
  font-weight: bold;
  width: 4.5rem;
  text-align: right;
}

.table-wrap {
  padding: 0 0.75rem 1.5rem 0.75rem;
}

table {
  border-collapse: collapse;  /* merges neighboring cell borders into one line */
  border: 0;
  width: 100%;
  position: relative;
  margin-top: 3rem;
}

table caption {
  color: #356eaf;
  font-size: 1.3em;
  font-weight: normal;
  position: absolute;
  top: -2.25rem;
  left: 0.5rem;
}

tbody td {
  width: 4rem;
}

tbody th {
  width: calc(100% - 12rem);
}

tr[class="total"] {
  border-bottom: 4px double #0a0a23;
  font-weight: bold;
}

tr[class="total"] th {
  text-align: left;
  padding: 0.5rem 0 0.25rem 0.5rem;
}

tr.total td {
  text-align: right;
  padding: 0 0.25rem;
}

tr.total td:nth-of-type(3) {  /* :nth-of-type(3) = the third td in its row */
  padding-right: 0.5rem;
}

tr.total:hover {
  background-color: #99c9ff;
}

td.current {
  font-style: italic;
}

tr.data {
  background-image: linear-gradient(to bottom, #dfdfe2 1.845rem, white 1.845rem);
}

tr.data th {
  text-align: left;
  padding-top: 0.3rem;
  padding-left: 0.5rem;
}

tr.data th .description {
  display: block;
  font-weight: normal;
  font-style: italic;
  padding: 1rem 0 0.75rem;
  margin-right: -13.5rem;
}

tr.data td {
  vertical-align: top;  /* lines cell text up with the top of the row */
  padding: 0.3rem 0.25rem 0;
  text-align: right;
}


tr.data td:last-of-type {
  padding-right: 0.5rem;
}
preview
▸ rwd lab Build a Book Inventory App html + css
Learned ConceptsIntroduced: [attr="value"] exact-match selector on class • [attr^="value"] starts-with selector • [attr~="value"] space-separated word selector • descendant combinator • child combinator (>) • :first-child pseudo-class • :nth-child() with -n+2 • overflow-x property • white-space: nowrap • font shorthand with line-height • scope attribute
Reinforced: Tables • caption • aria-label attribute • border-collapse property • linear-gradient() function • border-radius • box-sizing • font-family
a book inventory table: rows colored by reading status, status pills and dot ratings, all driven by attribute selectors on class (exact match, starts-with, whitespace-separated word), inside a wrapper that scrolls sideways on narrow screens.
html
index.html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Book Inventory</title>
    <link rel="stylesheet" href="styles.css">
  </head>
  <body>
    <main>
      <h1>Book Inventory</h1>
      <p>The shelf is full. The reading list is winning.</p>
      <div class="table-wrap">
        <table>
          <caption>A small shelf of stories, tracked one book at a time.</caption>
          <thead>
            <tr>
              <th scope="col">Title</th>  <!-- scope="col" tells screen readers this header labels the whole column -->
              <th scope="col">Author</th><th scope="col">Category</th>
              <th scope="col">Status</th>
              <th scope="col">Rate</th>
            </tr>
          </thead>
          <tbody>
            <tr class="read">
              <td>Ghost World</td>
              <td>Daniel Clowes</td>
              <td>Graphic novel</td>
              <td>
                <span class="status">Read</span>
              </td>
              <td>
                <span class="rate three" aria-label="3 out of 3">  <!-- aria-label gives the dot rating a text version for screen readers; "rate three" is two classes, which is why the CSS uses [class~="three"] -->
                  <span></span>
                  <span></span>
                  <span></span>
                </span>
              </td>
            </tr>
            <tr class="read">
              <td>Blankets</td>
              <td>Craig Thompson</td>
              <td>Graphic memoir</td>
              <td>
                <span class="status">Read</span>
              </td>
              <td>
                <span class="rate two" aria-label="2 out of 3">
                  <span></span>
                  <span></span>
                  <span></span>
                </span>
              </td>
            </tr>
            <tr class="read">
              <td>Player Piano (aka Utopia 14)</td>
              <td>Kurt Vonnegut</td>
              <td>Science fiction</td>
              <td>
                <span class="status">Read</span>
              </td>
              <td>
                <span class="rate one" aria-label="1 out of 3">
                  <span></span>
                  <span></span>
                  <span></span>
                </span>
              </td>
            </tr>
            <tr class="in-progress">
              <td>Habibi</td>
              <td>Craig Thompson</td>
              <td>Graphic novel</td>
              <td>
                <span class="status">In Progress</span>
              </td>
              <td>
                <span class="rate" aria-label="Not rated">
                  <span></span>
                  <span></span>
                  <span></span>
                </span>
              </td>
            </tr>
            <tr class="to-read">
              <td>Building Stories</td>
              <td>Chris Ware</td>
              <td>Graphic Novel</td>
              <td>
                <span class="status">To Read</span>
              </td>
              <td>
                <span class="rate" aria-label="Not rated">
                  <span></span>
                  <span></span>
                  <span></span>
                </span>
              </td>
            </tr>
          </tbody>
        </table>
      </div>
    </main>
  </body>
  </html>
css
styles.css

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	padding: 40px 20px;
	background: #282330;
	color: #292333;
	font-family: Georgia, serif;
}

main {
	max-width: 1050px;
	margin: auto;
}

h1 {
	margin-bottom: 8px;
	color: #edc2ab;
	font-size: 2.5rem;
}

main > p {
	margin-bottom: 28px;
	color: #c9b6d4;
}

.table-wrap {
	overflow-x: auto;  /* adds a horizontal scrollbar to the wrapper only when the table is too wide */
	border: 2px solid #b19abc;
	border-radius: 8px;
}

table {
	width: 100%;
	border-collapse: collapse;
	background: #f6efe7;
}

caption {
	padding: 16px;
	background: #3d3348;
	color: #f6efe7;
	text-align: left;
}

th {
	padding: 18px 16px;
	background: #51415d;
	color: #fff;
	text-align: left;
}

td {
	padding: 18px 16px;
	border-bottom: 1px solid #c6bdc7;
}

td:first-child {
	font-weight: bold;
}

span[class="status"],  /* [class="status"] = exact match; [class^="rate"] = class value starts with "rate" */
span[class^="rate"] {
	width: 120px;
	height: 36px;
	padding: 6px 8px;
	white-space: nowrap;  /* keeps the text on one line */
	vertical-align: middle;
	text-align: center;
}

span[class="status"] {
	border-radius: 20px;
	font: 14px/20px sans-serif;  /* font shorthand: size/line-height family */
}

span {
	display: inline-block;
}

tr[class="read"] {
	background-image: linear-gradient(90deg, #eafbea, #d7f5d7);
}

tr[class="to-read"] {
	background-image: linear-gradient(90deg, #fff7e0, #ffeebf);
}

tr[class="in-progress"] {
	background-image: linear-gradient(90deg, #e6efff, #cfe0ff);
}

tr[class="to-read"] span[class="status"] {
	border: 2px solid #936d00;
	background-image: linear-gradient(90deg, #ffe9a8, #ffd766);
}

tr[class="read"] span[class="status"] {
	border: 2px solid #2e702e;
	background-image: linear-gradient(90deg, #bff0bf, #8fe08f);
}

tr[class="in-progress"] span[class="status"] {
	border: 2px solid #39549b;
	background-image: linear-gradient(90deg, #bcd2ff, #8fb0ff);
}

span[class^="rate"] > span {
	width: 14px;
	height: 14px;
	margin: 2px;
	border: 1px solid #77627c;
	border-radius: 50%;
	background-color: #fff;
}

span[class~="one"] span:first-child {  /* [class~="one"] matches the word one inside a space-separated class list */
	background-image: linear-gradient(45deg, #ffd75e, #ffb300);
}

span[class~="two"] span:nth-child(-n+2) {  /* :nth-child(-n+2) = the first two children */
	background-image: linear-gradient(45deg, #ffd75e, #ffb300);
}

span[class~="three"] span {
	background-image: linear-gradient(45deg, #ffd75e, #ffb300);
}
preview
▸ CSS Responsive Design 2 items · 2 built
▸ rwd workshop Design a Piano html + css
Learned ConceptsIntroduced: float property • min-width media feature • combining media conditions with and (a breakpoint range) • compound class selector (.key.black--key) • box-sizing: inherit • negative offset value (left: -18px)
Reinforced: media queries (@media with max-width) • ::after pseudo-element • content property • position: relative • position: absolute • top, right, bottom and left offset properties • overflow property • border-radius property • margin: auto centering • universal selector (*) • box-sizing: border-box • width and height • viewport meta tag
a piano made of divs: white keys float side by side, black keys are ::after pieces nudged over the gaps, and two media queries resize the whole piano for phone, tablet and desktop.
html
index.html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>Piano</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="stylesheet" href="./styles.css">
  </head>
  <body>
    <div id="piano">
      <img class="logo" src="https://cdn.freecodecamp.org/platform/universal/fcc_primary.svg" alt="freeCodeCamp Logo" />
      <div class="keys">
        <div class="key"></div>
        <div class="key black--key"></div>  <!-- two classes on one element: the first sizes and colors the key, the second turns it into a black key (drawn with ::after in the css) -->
        <div class="key black--key"></div>
        <div class="key"></div>
        <div class="key black--key"></div>
        <div class="key black--key"></div>
        <div class="key black--key"></div>

        <div class="key"></div>
        <div class="key black--key"></div>
        <div class="key black--key"></div>
        <div class="key"></div>
        <div class="key black--key"></div>
        <div class="key black--key"></div>
        <div class="key black--key"></div>

        <div class="key"></div>
        <div class="key black--key"></div>
        <div class="key black--key"></div>
        <div class="key"></div>
        <div class="key black--key"></div>
        <div class="key black--key"></div>
        <div class="key black--key"></div>
      </div>
    </div>
  </body>
</html>
css
styles.css
html {
  box-sizing: border-box;
}

*, *::before, *::after {
  box-sizing: inherit;  /* inherit = copy the parent's value; html is set once and every element follows */
}

#piano {
  background-color: #00471b;
  width: 992px;
  height: 290px;
  margin: 80px auto;
  padding: 90px 20px 0 20px;
  position: relative;
  border-radius: 10px;
}

.keys {
  background-color: #040404;
  width: 949px;
  height: 180px;
  padding-left: 2px;
  overflow: hidden;  /* clips the floated keys at the box edge and makes this box contain its floats */
}

.key {
  background-color: #ffffff;
  position: relative;
  width: 41px;
  height: 175px;
  margin: 2px;
  float: left;  /* pulls each key out of the normal flow and lines them up side by side, left to right */
  border-radius: 0 0 3px 3px;
}

.key.black--key::after {  /* compound selector: only elements with both classes; ::after draws the black key on top */
  background-color: #1d1e22;
  content: "";
  position: absolute;
  left: -18px;  /* a negative offset nudges the black key left so it straddles the gap between two white keys */
  width: 32px;
  height: 100px;
  border-radius: 0 0 3px 3px;
}

.logo {
  width: 200px;
  position: absolute;
  top: 23px;
}

@media (max-width: 768px) {  /* breakpoint: these rules only apply when the viewport is 768px wide or narrower */
  #piano {
    width: 358px;
  }

  .keys {
    width: 318px;
  }

  .logo {
    width: 150px;
  }
}

@media (max-width: 1199px) and (min-width: 769px) {  /* and joins two conditions into a range: only tablet widths (769px to 1199px) match */
  #piano {
    width: 675px;
  }  
  .keys {
    width: 633px;
  }
}
preview
▸ rwd cert project Build a Technical Documentation Page html + css
Learned ConceptsIntroduced: position: fixed • position: static • overflow-y property • fragment links (href="#id") • code element • margin-left to clear a fixed sidebar
Reinforced: media queries (@media with max-width) • nav, header, main and section elements • display: block • border-top, border-right and border-bottom • line-height property • monospace font stack • max-width • padding • box-sizing: border-box • universal selector (*)
a documentation page with a position: fixed navbar of fragment links that jump to each section; at 768px a media query sets the navbar to static so it stacks on top.
html
index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CSS Documentation</title>  <!-- the tab title and the main thing search engines and screen readers announce first -->
<meta name="description" content="A short reference to core CSS ideas: selectors, the box model, positioning and more.">  <!-- the summary search engines can show under the page title -->
<link rel="stylesheet" href="styles.css">
</head>
<body>
<nav id="navbar">
<header>CSS Documentation</header>
<a class="nav-link" href="#Introduction">Introduction</a>  <!-- fragment link: # plus an id jumps to the element with that id on this page -->
<a class="nav-link" href="#Selectors">Selectors</a>
<a class="nav-link" href="#The_Box_Model">The Box Model</a>
<a class="nav-link" href="#Positioning">Positioning</a>
<a class="nav-link" href="#Responsive_Design">Responsive Design</a>
</nav>
<main id="main-doc">
<section class="main-section" id="Introduction">  <!-- this id is where the Introduction nav link jumps to -->
<header>Introduction</header>
<p>CSS (Cascading Style Sheets) is the language used to style the visual presentation of web
pages.</p>
<p>It works alongside HTML, which provides structure, while CSS controls color, layout, and
typography.</p>
<ul>
<li>CSS separates content from presentation.</li>
<li>One stylesheet can style many pages.</li>
</ul>
</section>
<section class="main-section" id="Selectors">
<header>Selectors</header>
<p>A selector targets the HTML elements you want to style.</p>
<p>You can select by tag, class, id, or attribute.</p>
<code>p { color: navy; }</code>  <!-- code marks a snippet of code; the css makes it a block with a monospace font -->
<code>.button { padding: 8px; }</code>
<ul>
<li>Tag selectors target every element of a type.</li>
<li>Class selectors are reusable.</li>
</ul>
</section>
<section class="main-section" id="The_Box_Model">
<header>The Box Model</header>
<p>Every element is a rectangular box made of content, padding, border, and margin.</p>
<code>div { padding: 16px; border: 1px solid; }</code>
<p>Understanding the box model is key to controlling spacing.</p>
</section>
<section class="main-section" id="Positioning">
<header>Positioning</header>
<p>The position property controls how an element sits in the document flow.</p>
<code>.box { position: absolute; }</code>
<p>Values include static, relative, absolute, fixed, and sticky.</p>
</section>
<section class="main-section" id="Responsive_Design">
<header>Responsive Design</header>
<p>Responsive design lets one site adapt to any screen size.</p>
<code>@media (min-width: 768px) { }</code>
<p>Media queries apply styles based on the device.</p>
<ul>
<li>Use relative units for fluid layouts.</li>
</ul>
</section>
</main>
</body>
</html>
css
styles.css
* { box-sizing: border-box; }
body {
margin: 0;
font-family: -apple-system, Helvetica, Arial, sans-serif;
color: #2a2e3a;
line-height: 1.6;
}
/* fixed navbar on the left edge (test 21) */
#navbar {
position: fixed;  /* pins the navbar to the viewport so it stays put while the page scrolls */
top: 0;
left: 0;
width: 280px;
height: 100%;
border-right: 2px solid #e2e5ec;
background: #f6f7fa;
padding: 20px;
overflow-y: auto;  /* adds a vertical scrollbar to the navbar only if its links don't fit */
}
#navbar header {
font-size: 1.4rem;
font-weight: 700;
margin-bottom: 16px;
}
.nav-link {
display: block;
padding: 8px 0;
color: #3a5a8a;
text-decoration: none;
border-top: 1px solid #e2e5ec;
}
/* main content sits to the right of the fixed navbar */
#main-doc {
margin-left: 300px;  /* pushes the content right so the fixed navbar (280px wide) doesn't cover it */
padding: 24px 32px;
max-width: 800px;
}
.main-section header {
font-size: 1.6rem;
margin-top: 28px;
}
code {
display: block;
background: #f3f4f7;
padding: 8px 12px;
border-radius: 4px;
font-family: Menlo, Consolas, monospace;
margin: 8px 0;
}
/* media query (test 22): stack navbar on top for small screens */
@media (max-width: 768px) {
#navbar {
position: static;  /* static = back in the normal flow, so the navbar sits on top instead of floating at the side */
width: 100%;
height: auto;
border-right: none;
border-bottom: 2px solid #e2e5ec;
}
#main-doc {
margin-left: 0;
}
}
preview
▸ CSS Variables 2 items · 2 built
▸ rwd workshop Build a City Skyline html + css
Learned ConceptsIntroduced: custom properties (CSS variables) • :root selector • var() function • redefining variables inside a media query • radial-gradient() function • multiple background layers • vh unit • justify-content: space-evenly value
Reinforced: linear-gradient() function • repeating-linear-gradient() function • hard color stops • color stops • transparent keyword • CSS shapes made with borders (border triangles) • display: flex • flex-direction property • flex-wrap property • align-items property • position: absolute • position: relative • border-radius property • media queries (@media with max-width) • vw unit • overflow property • box-sizing: border-box • universal selector (*)
a skyline drawn with divs and gradients: eight custom properties in :root color every building, a radial-gradient sun lights the sky, and below 1000px a media query redefines the variables to turn it into a night scene.
html
index.html
<!DOCTYPE html>
<html lang="en">    
  <head>
    <meta charset="UTF-8">
    <title>City Skyline</title>
    <link href="styles.css" rel="stylesheet" />   
  </head>

  <body>
    <div class="background-buildings sky">  <!-- background-buildings lays out the row; sky paints the radial-gradient behind it -->
      <div></div>
      <div></div>
      <div class="bb1 building-wrap">
        <div class="bb1a bb1-window"></div>
        <div class="bb1b bb1-window"></div>
        <div class="bb1c bb1-window"></div>
        <div class="bb1d"></div>
      </div>
      <div class="bb2">
        <div class="bb2a"></div>
        <div class="bb2b"></div>
      </div>
      <div class="bb3"></div>
      <div></div>
      <div class="bb4 building-wrap">
        <div class="bb4a"></div>
        <div class="bb4b"></div>
        <div class="bb4c window-wrap">
          <div class="bb4-window"></div>
          <div class="bb4-window"></div>
          <div class="bb4-window"></div>
          <div class="bb4-window"></div>
        </div>
      </div>
      <div></div>
      <div></div>
    </div>

    <div class="foreground-buildings">
      <div></div>
      <div></div>
      <div class="fb1 building-wrap">
        <div class="fb1a"></div>
        <div class="fb1b"></div>
        <div class="fb1c"></div>
      </div>
      <div class="fb2">
        <div class="fb2a"></div>
        <div class="fb2b window-wrap">
          <div class="fb2-window"></div>
          <div class="fb2-window"></div>
          <div class="fb2-window"></div>
        </div>
      </div>
      <div></div>
      <div class="fb3 building-wrap">
        <div class="fb3a window-wrap">
          <div class="fb3-window"></div>
          <div class="fb3-window"></div>
          <div class="fb3-window"></div>
        </div>
        <div class="fb3b"></div>
        <div class="fb3a"></div>
        <div class="fb3b"></div>
      </div>
      <div class="fb4">
        <div class="fb4a"></div>
        <div class="fb4b">
          <div class="fb4-window"></div>
          <div class="fb4-window"></div>
          <div class="fb4-window"></div>
          <div class="fb4-window"></div>
          <div class="fb4-window"></div>
          <div class="fb4-window"></div>
        </div>
      </div>
      <div class="fb5"></div>
      <div class="fb6"></div>
      <div></div>
      <div></div>
    </div>
  </body>
</html>
css
styles.css
:root {  /* :root = the html element, so variables declared here work anywhere on the page */
  --building-color1: #aa80ff;  /* custom property (css variable): a --name that stores a value to reuse */
  --building-color2: #66cc99;
  --building-color3: #cc6699;
  --building-color4: #538cc6;
  --window-color1: #bb99ff;
  --window-color2: #8cd9b3;
  --window-color3: #d98cb3;
  --window-color4: #8cb3d9;
}

* {
  box-sizing: border-box;
}

body {
  height: 100vh;  /* vh = 1% of the viewport height, so 100vh fills the whole window */
  margin: 0;
  overflow: hidden;
}

.background-buildings, .foreground-buildings {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: space-evenly;  /* space-evenly = equal gaps between the buildings and at both ends */
  position: absolute;
  top: 0;
}

.building-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.window-wrap {
  display: flex;
  align-items: center;
  justify-content: space-evenly;
}

.sky {
  background: radial-gradient(
      closest-corner circle at 15% 15%,  /* radial-gradient shape: a circle sized to the closest corner, centered 15% across and 15% down (the sun) */
      #ffcf33,
      #ffcf33 20%,
      #ffff66 21%,
      #bbeeff 100%
    );
}

/* BACKGROUND BUILDINGS - "bb" stands for "background building" */
.bb1 {
  width: 10%;
  height: 70%;
}

.bb1a {
  width: 70%;
}
  
.bb1b {
  width: 80%;
}
  
.bb1c {
  width: 90%;
}

.bb1d {
  width: 100%;
  height: 70%;
  background: linear-gradient(
      var(--building-color1) 50%,  /* var() reads the value stored in --building-color1 */
      var(--window-color1)
    );
}

.bb1-window {
  height: 10%;
  background: linear-gradient(
      var(--building-color1),
      var(--window-color1)
    );
}

.bb2 {
  width: 10%;
  height: 50%;
}

.bb2a {
  border-bottom: 5vh solid var(--building-color2);  /* border triangle for the roof; vh and vw scale it with the window */
  border-left: 5vw solid transparent;
  border-right: 5vw solid transparent;
}

.bb2b {
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
      var(--building-color2),
      var(--building-color2) 6%,
      var(--window-color2) 6%,
      var(--window-color2) 9%
    );
}

.bb3 {
  width: 10%;
  height: 55%;
  background: repeating-linear-gradient(
      90deg,
      var(--building-color3),
      var(--building-color3),
      var(--window-color3) 15%
    );
}

.bb4 {
  width: 11%;
  height: 58%;
}

.bb4a {
  width: 3%;
  height: 10%;
  background-color: var(--building-color4);
}

.bb4b {
  width: 80%;
  height: 5%;
  background-color: var(--building-color4);
}
  
.bb4c {
  width: 100%;
  height: 85%;
  background-color: var(--building-color4);
}

.bb4-window {
  width: 18%;
  height: 90%;
  background-color: var(--window-color4);
}

/* FOREGROUND BUILDINGS - "fb" stands for "foreground building" */
.fb1 {
  width: 10%;
  height: 60%;
}

.fb1a {
  border-bottom: 7vh solid var(--building-color4);
  border-left: 2vw solid transparent;
  border-right: 2vw solid transparent;
}

.fb1b {
  width: 60%;
  height: 10%;
  background-color: var(--building-color4);
}
  
.fb1c {
  width: 100%;
  height: 80%;
  background: repeating-linear-gradient(
      90deg,
      var(--building-color4),
      var(--building-color4) 10%,
      transparent 10%,
      transparent 15%
    ),
    repeating-linear-gradient(  /* a second background layer: comma-separated gradients stack on top of each other */
      var(--building-color4),
      var(--building-color4) 10%,
      var(--window-color4) 10%,
      var(--window-color4) 90%
    );
}

.fb2 {
  width: 10%;
  height: 40%;
}

.fb2a {
  width: 100%;
  border-bottom: 10vh solid var(--building-color3);
  border-left: 1vw solid transparent;
  border-right: 1vw solid transparent;
}

.fb2b {
  width: 100%;
  height: 75%;
  background-color: var(--building-color3);
}

.fb2-window {
  width: 22%;
  height: 100%;
  background-color: var(--window-color3);
}

.fb3 {
  width: 10%;
  height: 35%;
}
  
.fb3a {
  width: 80%;
  height: 15%;
  background-color: var(--building-color1);
}
  
.fb3b {
  width: 100%;
  height: 35%;
  background-color: var(--building-color1);
}

.fb3-window {
  width: 25%;
  height: 80%;
  background-color: var(--window-color1);
}

.fb4 {
  width: 8%;
  height: 45%;
  position: relative;
  left: 10%;
}

.fb4a {
  border-top: 5vh solid transparent;
  border-left: 8vw solid var(--building-color1);
}

.fb4b {
  width: 100%;
  height: 89%;
  background-color: var(--building-color1);
  display: flex;
  flex-wrap: wrap;
}

.fb4-window {
  width: 30%;
  height: 10%;
  border-radius: 50%;
  background-color: var(--window-color1);
  margin: 10%;
}

.fb5 {
  width: 10%;
  height: 33%;
  position: relative;
  right: 10%;
  background: repeating-linear-gradient(
      var(--building-color2),
      var(--building-color2) 5%,
      transparent 5%,
      transparent 10%
    ),
    repeating-linear-gradient(
      90deg,
      var(--building-color2),
      var(--building-color2) 12%,
      var(--window-color2) 12%,
      var(--window-color2) 44%
    );
}

.fb6 {
  width: 9%;
  height: 38%;
  background: repeating-linear-gradient(
      90deg,
      var(--building-color3),
      var(--building-color3) 10%,
      transparent 10%,
      transparent 30%
    ),
    repeating-linear-gradient(
      var(--building-color3),
      var(--building-color3) 10%,
      var(--window-color3) 10%,
      var(--window-color3) 30%
    );
}

@media (max-width: 1000px) {  /* below 1000px wide the variables get new values, so every color swaps without touching the rules above */
  :root {
    --building-color1: #000;
    --building-color2: #000;
    --building-color3: #000;
    --building-color4: #000;
    --window-color1: #777; 
    --window-color2: #777;
    --window-color3: #777;
    --window-color4: #777;
  }

  .sky {
    background: radial-gradient(
        closest-corner circle at 15% 15%,
        #ccc,
        #ccc 20%,
        #445 21%,
        #223 100%
      );
  }
}
    
preview
▸ rwd lab Build an Availability Table html + css
Learned ConceptsIntroduced: custom properties storing shorthand values (--solid-border) • color stops with two positions • dashed border style
Reinforced: custom properties (:root and var()) • linear-gradient() function • gradientDirection value • child combinator (>) • descendant combinator • tables • caption • scope attribute • aria-label attribute • border-collapse property • logical properties (border-inline) • overflow-x property • min-width property • white-space: nowrap • display: flex • justify-content: space-between value • text-align • system-ui generic font family • box-sizing: border-box
a weekly meeting-availability heat map: six custom properties shade the cells from 0 to 5+ people, solid vs dashed borders (also variables) mark on-the-hour vs half-hour rows, and the legend gradient reuses the same colors.
html
index.html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Weekly Availability</title>
  <link rel="stylesheet" href="styles.css">
</head>
<body>
  <main>
    <h1>Find our overlap.</h1>
    <p>Less scheduling ping-pong. More getting things done.</p>
    <div class="table-wrap">
      <table>
        <caption>Weekly Meeting Availability Schedule</caption>
        <thead>
          <tr>
            <th scope="col">Time</th>
            <th scope="col">Monday</th>
            <th scope="col">Tuesday</th>
            <th scope="col">Wednesday</th>
            <th scope="col">Thursday</th>
            <th scope="col">Friday</th>
          </tr>
        </thead>
        <tbody>
          <tr class="sharp">  <!-- sharp = an on-the-hour row (solid line under it); half = a half-hour row (dashed line) -->
            <th class="time" scope="row">9:00 AM</th>
            <td class="available-0" aria-label="0 available">0</td>
            <td class="available-1" aria-label="1 available">1</td>
            <td class="available-2" aria-label="2 available">2</td>
            <td class="available-3" aria-label="3 available">3</td>
            <td class="available-4" aria-label="4 available">4</td>
          </tr>
          <tr class="half">
            <th class="time" scope="row">9:30 AM</th>
            <td class="available-1" aria-label="1 available">1</td>
            <td class="available-2" aria-label="2 available">2</td>
            <td class="available-3" aria-label="3 available">3</td>
            <td class="available-4" aria-label="4 available">4</td>
            <td class="available-5" aria-label="5+ available">5+</td>
          </tr>
          <tr class="sharp">
            <th class="time" scope="row">10:00 AM</th>
            <td class="available-2" aria-label="2 available">2</td>
            <td class="available-3" aria-label="3 available">3</td>
            <td class="available-4" aria-label="4 available">4</td>
            <td class="available-5" aria-label="5+ available">5+</td>
            <td class="available-0" aria-label="0 available">0</td>
          </tr>
          <tr class="half">
            <th class="time" scope="row">10:30 AM</th>
            <td class="available-3" aria-label="3 available">3</td>
            <td class="available-4" aria-label="4 available">4</td>
            <td class="available-5" aria-label="5+ available">5+</td>
            <td class="available-0" aria-label="0 available">0</td>
            <td class="available-1" aria-label="1 available">1</td>
          </tr>
          <tr class="sharp">
            <th class="time" scope="row">11:00 AM</th>
            <td class="available-4" aria-label="4 available">4</td>
            <td class="available-5" aria-label="5+ available">5+</td>
            <td class="available-0" aria-label="0 available">0</td>
            <td class="available-1" aria-label="1 available">1</td>
            <td class="available-2" aria-label="2 available">2</td>
          </tr>
          <tr class="half">
            <th class="time" scope="row">11:30 AM</th>
            <td class="available-5" aria-label="5+ available">5+</td>
            <td class="available-0" aria-label="0 available">0</td>
            <td class="available-1" aria-label="1 available">1</td>
            <td class="available-2" aria-label="2 available">2</td>
            <td class="available-3" aria-label="3 available">3</td>
          </tr>
        </tbody>
      </table>
    </div>
    <div id="legend">
      <span>Availability</span>
      <div id="legend-gradient"></div>  <!-- empty on purpose: the gradient is painted by css (background-image) -->
      <div class="labels">
        <span>0 people</span>
        <span>5+ people</span>
      </div>
    </div>
  </main>
</body>
</html>
css
styles.css
                
:root {
 --color0: #f3ece8;  /* the six-step color scale lives in :root; the cells and the legend both read from it */
 --color1: #e2d5e9;
 --color2: #c4acd3;
 --color3: #a98cb9;
 --color4: #856694;
 --color5: #5d416e;
 --solid-border: 2px solid #55465c;  /* a custom property can store a whole shorthand value (width, style, color), not just one color */
 --dashed-border: 1px dashed #55465c;  /* dashed = a broken line; half-hour rows use it, on-the-hour rows use the solid one */
}

* { 
    box-sizing: border-box; 
}

body { 
    margin: 0; 
    background: #24202b; 
    color: #f3ece8; 
    font-family: system-ui, sans-serif; 
    padding: 40px 20px; 
}

main { 
    max-width: 900px; 
    margin: auto; 
}

h1 { 
    color: #e4b6a1; 
    font-size: 2.6rem; 
    margin-bottom: 8px; 
}

p { 
    color: #cbbbce; 
    margin-bottom: 32px; 
}

.table-wrap { 
    overflow-x: auto; 
}

table { 
    width: 100%; 
    border-collapse: collapse; 
    text-align: center; 
    color: #302337; 
    background: #f3ece8; 
}

caption { 
    color: #f3ece8; 
    text-align: left; 
    padding: 16px 0; 
    font-size: 1.15rem; 
    font-weight: bold; 
}

th { 
    background: #3b3045; 
    color: #fff; 
    padding: 16px; 
}

td { 
    height: 54px; 
    min-width: 100px; 
    border-inline: 1px solid #aa98b2; 
}

.time { 
    white-space: nowrap; 
    font-size: 0.9rem; 
}

.available-0 { 
    background-color: var(--color0);  /* var() reads --color0 from :root */
}

.available-1 { 
    background-color: 
    var(--color1); 
}

.available-2 { 
    background-color: var(--color2); 
}

.available-3 { 
    background-color: var(--color3); 
}

.available-4 { 
    background-color: var(--color4); 
    color: white; 
}

.available-5 { 
    background-color: var(--color5); 
    color: white; 
}

.sharp > td { 
    border-bottom: var(--solid-border);  /* var() drops the whole stored border in: one value instead of three */
}

.half > td { 
    border-bottom: var(--dashed-border); 
}

#legend { 
    margin: 28px auto 0; 
    max-width: 360px; 
    text-align: center; 
}

#legend > span { 
    display: block; 
    margin-bottom: 10px; 
}

#legend-gradient { 
    height: 24px; 
    border: 1px solid #cbbbce; 
    background-image: linear-gradient(to right, 
    var(--color0) 0% 17%,  /* two positions on one color stop = a solid band from 0% to 17%, no blending */
    var(--color1) 17% 33%, 
    var(--color2) 33% 50%, 
    var(--color3) 50% 67%, 
    var(--color4) 67% 83%, 
    var(--color5) 83% 100%); 
}

.labels { 
    display: flex; 
    justify-content: space-between; 
    font-size: 0.8rem; 
    margin-top: 6px; 
}

.sharp td { 
    border-bottom: var(--solid-border); 
}

.half td { 
    border-bottom: var(--dashed-border); 
}
preview
▸ CSS Grid 4 items · 4 built
▸ rwd workshop CSS Grid html + css
the fCC grid workshop — a full holy-grail layout in pure grid: a three-column body (sidebar / main / aside) with a full-width header and footer, sized with fr units and pinned by explicit grid-column / grid-row lines. the comments sit on the lines that set up the tracks.
html
index.html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <link rel="stylesheet" href="styles.css">
</head>
<body>
  <div class="container"> <!-- the grid container: the CSS gives it display: grid, so each child div is a grid item -->
    <div class="header">Header</div>
    <div class="sidebar">Sidebar</div>
    <div class="main">Main</div>
    <div class="aside">Aside</div>
    <div class="footer">Footer</div>
  </div>
</body>
</html>
css
styles.css
.container {
    display: grid; /* display: grid makes this element a grid container */
    grid-template-columns: 1fr 2fr 1fr; /* 3 columns; fr is a share of the free space, so the middle column is twice as wide as each side */
    grid-template-rows: auto 1fr auto; /* 3 rows: auto fits the content (header, footer), 1fr takes the leftover height */
    gap: 1rem; /* gap sets the space between grid cells, rows and columns */
    min-height: 100vh;
}

.header {
    grid-column: 1 / -1; /* grid lines are numbered; 1 is the first line, -1 is the last, so this spans every column */
    grid-row: 1;
}

.sidebar {
    grid-column: 1;
    grid-row: 2;
}

.main {
    grid-column: 2;
    grid-row: 2;
}

.aside {
    grid-column: 3;
    grid-row: 2;
}

.footer {
    grid-column: 1 / -1;
    grid-row: 3;
}
preview
▸ rwd workshop Build a Magazine html + css
Learned ConceptsIntroduced: grid line numbers (grid-column: 2 / 3) • negative grid lines (grid-column: 1 / -1) • min-content value • row-gap property • grid-template-rows property • grid-auto-flow property • grid-auto-columns property • nested grids • column-width property • text-align: justify • rem unit • html font-size: 62.5% • loading="lazy" attribute • Font Awesome icon classes
Reinforced: display: grid • grid-template-columns property • repeat() function • minmax() function • place-items property • gap property • object-fit property • ::first-letter pseudo-element • ::before pseudo-element • ::after pseudo-element • content property • media queries (@media with max-width) • :hover pseudo-class • Google Fonts link element • font-family • letter-spacing property • float property • universal selector (*) • box-sizing: border-box
a magazine article laid out in CSS Grid: a three-column page frame with a centered content column, nested grids for the header and the image gallery, multi-column justified text with a drop cap, and a stack of media queries for phones.
html
index.html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Magazine</title>
    <link
      href="https://fonts.googleapis.com/css?family=Anton%7CBaskervville%7CRaleway&display=swap"
      rel="stylesheet"
    />
    <link
      rel="stylesheet"
      href="https://use.fontawesome.com/releases/v5.8.2/css/all.css"
    />
    <link rel="stylesheet" href="styles.css" />
  </head>
  <body>
    <main>
      <section class="heading">
        <header class="hero">
          <img
            src="https://cdn.freecodecamp.org/platform/universal/fcc_meta_1920X1080-indigo.png"
            alt="freecodecamp logo"
            loading="lazy"
            class="hero-img"
          />  <!-- loading="lazy" = the browser waits to download the image until it is near the screen -->
          <h1 class="hero-title">OUR NEW CURRICULUM</h1>
          <p class="hero-subtitle">
            Our efforts to restructure our curriculum with a more project-based
            focus
          </p>
        </header>
        <div class="author">
          <p class="author-name">
            By
            <a href="https://freecodecamp.org" target="_blank" rel="noreferrer"
              >freeCodeCamp</a
            >
          </p>
          <p class="publish-date">March 7, 2019</p>
        </div>
        <div class="social-icons">
          <a href="https://www.facebook.com/freecodecamp/">
            <i class="fab fa-facebook-f"></i>  <!-- Font Awesome icon: the fab and fa classes draw the icon from the font loaded in the head -->
          </a>
          <a href="https://twitter.com/freecodecamp/">
            <i class="fab fa-twitter"></i>
          </a>
          <a href="https://instagram.com/freecodecamp">
            <i class="fab fa-instagram"></i>
          </a>
          <a href="https://www.linkedin.com/school/free-code-camp/">
            <i class="fab fa-linkedin-in"></i>
          </a>
          <a href="https://www.youtube.com/freecodecamp">
            <i class="fab fa-youtube"></i>
          </a>
        </div>
      </section>
      <section class="text">
        <p class="first-paragraph">
          Soon the freeCodeCamp curriculum will be 100% project-driven learning. Instead of a series of coding challenges, you'll learn through building projects - step by step. Before we get into the details, let me emphasize: we are not changing the certifications. All 6 certifications will still have the same 5 required projects. We are only changing the optional coding challenges.
        </p>
        <p>
          After years - years - of pondering these two problems and how to solve them, I slipped, hit my head on the sink, and when I came to I had a revelation! A vision! A picture in my head! A picture of this! This is what makes time travel possible: the flux capacitor!
        </p>
        <p>
          It wasn't as dramatic as Doc's revelation in Back to the Future. It
          just occurred to me while I was going for a run. The revelation: the entire curriculum should be a series of projects. Instead of individual coding challenges, we'll just have projects, each with their own seamless series of tests. Each test gives you just enough information to figure out how to get it to pass. (And you can view hints if that isn't enough.)
        </p>
        <blockquote>
          <hr />
          <p class="quote">
            The entire curriculum should be a series of projects
          </p>
          <hr />
        </blockquote>
        <p>
          No more walls of explanatory text. No more walls of tests. Just one
          test at a time, as you build up a working project. Over the course of passing thousands of tests, you build up projects and your own understanding of coding fundamentals. There is no transition between lessons and projects, because the lessons themselves are baked into projects. And there's plenty of repetition to help you retain everything because - hey - building projects in real life has plenty of repetition.
        </p>
        <p>
          The main design challenge is taking what is currently paragraphs of explanation and instructions and packing them into a single test description text. Each project will involve dozens of tests like this. People will be coding the entire time, rather than switching back and forth from "reading mode" to "coding mode".
        </p>
        <p>
          Instead of a series of coding challenges, people will be in their code editor passing one test after another, quickly building up a project. People will get into a real flow state, similar to what they experience when they build the required projects at the end of each certification. They'll get that sense of forward progress right from the beginning. And freeCodeCamp will be a much smoother experience.
        </p>
      </section>
      <section class="text text-with-images">  <!-- text-with-images is a grid inside the page grid: this section is a grid item and a grid container at once -->
        <article class="brief-history">
          <h3 class="list-title">A Brief History</h3>
          <p>Of the Curriculum</p>
          <ul class="lists">
            <li>
              <h4 class="list-subtitle">V1 - 2014</h4>
              <p>
                We launched freeCodeCamp with a simple list of 15 resources,
                including Harvard's CS50 and Stanford's Database Class.
              </p>
            </li>
            <li>
              <h4 class="list-subtitle">V2 - 2015</h4>
              <p>We added interactive algorithm challenges.</p>
            </li>
            <li>
              <h4 class="list-subtitle">V3 - 2015</h4>
              <p>
                We added our own HTML+CSS challenges (before we'd been relying on
                General Assembly's Dash course for these).
              </p>
            </li>
            <li>
              <h4 class="list-subtitle">V4 - 2016</h4>
              <p>
                We expanded the curriculum to 3 certifications, including Front-End,
                Back-End, and Data Visualization. They each had 10 required
                projects, but only the Front-End section had its own challenges.
                For the other certs, we were still using external resources like
                Node School.
              </p>
            </li>
            <li>
              <h4 class="list-subtitle">V5 - 2017</h4>
              <p>We added the back-end and data visualization challenges.</p>
            </li>
            <li>
              <h4 class="list-subtitle">V6 - 2018</h4>
              <p>
                We launched 6 new certifications to replace our old ones. This was
                the biggest curriculum improvement to date.
              </p>
            </li>
          </ul>
        </article>
        <aside class="image-wrapper">
          <img
            src="https://cdn.freecodecamp.org/testable-projects-fcc/images/random-quote-machine.png"
            alt="image of the quote machine project"
            loading="lazy"
            class="image-1"
            width="600"
            height="400"
          />
          <img
            src="https://cdn.freecodecamp.org/testable-projects-fcc/images/calc.png"
            alt="image of a calculator project"
            loading="lazy"
              class="image-2"
            width="400"
            height="400"
          />
          <blockquote class="image-quote">
            <hr />
            <p class="quote">
              The millions of people who are learning to code through freeCodeCamp
              will have an even better resource to help them learn these
              fundamentals.
            </p>
            <hr />
          </blockquote>
          <img
            src="https://cdn.freecodecamp.org/testable-projects-fcc/images/survey-form-background.jpeg"
            alt="four people working on code"
            loading="lazy"
            class="image-3"
            width="600"
            height="400"
          />
        </aside>
      </section>
    </main>
  </body>
</html>
css
styles.css
*,
::before,
::after {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

html {
  font-size: 62.5%;  /* 62.5% of 16px = 10px, so 1rem = 10px and the math is easy (1.8rem = 18px) */
}

body {
  font-family: 'Baskervville', serif;
  color: linen;
  background-color: rgb(20, 30, 40);
}

h1 {
  font-family: 'Anton', sans-serif;
}

h2, h3, h4, h5, h6 {
  font-family: 'Raleway', sans-serif;
}

a {
  text-decoration: none;
  color: linen;
}

main {
  display: grid;
  grid-template-columns: minmax(2rem, 1fr) minmax(min-content, 94rem) minmax(2rem, 1fr);  /* 3 columns: flexible side gutters around a centered content column that is never narrower than its content or wider than 94rem */
  row-gap: 3rem;  /* row-gap = space between grid rows only (column-gap is the other direction) */
}

img {
  width: 100%;
  object-fit: cover;
}

hr {
  margin: 1.5rem 0;
  border: 1px solid rgba(120, 120, 120, 0.6);
}

.heading {
  grid-column: 2 / 3;  /* grid lines are numbered from 1: starts at line 2, ends at line 3, so it fills the middle column */
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  row-gap: 1.5rem;
}

.text {
  grid-column: 2 / 3;
  font-size: 1.8rem;
  letter-spacing: 0.6px;
  column-width: 25rem;  /* multi-column layout: the text flows into as many columns as fit, each at least 25rem wide */
  text-align: justify;  /* justify = stretches each line so both edges are flush */
}

.hero {
  grid-column: 1 / -1;  /* -1 = the last grid line, so 1 / -1 spans every column */
  position: relative;
}

.hero-title {
  text-align: center;
  color: orangered;
  font-size: 8rem;
}

.hero-subtitle {
  font-size: 2.4rem;
  color: orangered;
  text-align: center;
}

.author {
  font-size: 2rem;
  font-family: "Raleway", sans-serif;
}

.author-name a:hover {
  background-color: #306203;
}

.publish-date {
  color: rgba(255, 255, 255, 0.5);
}

.social-icons {
  display: grid;
  font-size: 3rem;
  grid-template-columns: repeat(5, 1fr);
  grid-auto-flow: column;  /* new items go into new columns instead of new rows */
  grid-auto-columns: 1fr;  /* any extra columns the grid makes by itself get equal width */
  align-items: center;
}

.first-paragraph::first-letter {
  font-size: 6rem;
  color: orangered;
  float: left;
  margin-right: 1rem;
}

.quote {
  color: #00beef;
  font-size: 2.4rem;
  text-align: center;
  font-family: "Raleway", sans-serif;
}

.quote::before {
  content: '" ';
}

.quote::after {
  content: ' "';
}

.text-with-images {
  display: grid;
  grid-template-columns: 1fr 2fr;
  column-gap: 3rem;
  margin-bottom: 3rem;
}

.lists {
  list-style-type: none;
  margin-top: 2rem;
}

.lists li {
  margin-bottom: 1.5rem;
}

.list-title, .list-subtitle {
  color: #00beef;
}

.image-wrapper {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: repeat(3, min-content);  /* 3 rows, each only as tall as its content (min-content) */
  gap: 2rem;
  place-items: center;
}

.image-1, .image-3 {
  grid-column: 1 / -1;
}

@media only screen and (max-width: 720px) {  /* only screen = skip print; the breakpoints stack from wide to narrow: 720, 600, 550, 420 */
  .image-wrapper {
    grid-template-columns: 1fr;
  }
}

@media only screen and (max-width: 600px) {
  .text-with-images {
    grid-template-columns: 1fr;
  }
}

@media only screen and (max-width: 550px) {
  .hero-title {
    font-size: 6rem;
  }
  
  .hero-subtitle,
  .author,
  .quote,
  .list-title {
    font-size: 1.8rem;
  }
  
  .social-icons {
    font-size: 2rem;
  }

  .text {
    font-size: 1.6rem;
  } 
}

@media only screen and (max-width: 420px) {
  .hero-title {
    font-size: 4.5rem;
  }
}
preview
▸ rwd lab Design a Newspaper Layout html + css
Learned ConceptsIntroduced: grid-template-areas • grid-area property • grid-template-rows with auto and fr • spanning cells by repeating an area name • min-width: 0 on a grid item • filter: grayscale()
Reinforced: display: grid • grid-template-columns property • repeat() function • fr unit • gap property • clamp() function • border-style: double • box-shadow property • object-fit property • figure and figcaption elements • letter-spacing property • text-transform property • line-height property • max-width • margin: auto centering • box-sizing: border-box • universal selector (*)
a newspaper front page drawn with grid-template-areas: a masthead row, a feature plus a secondary story, a grayscale cover photo spanning two rows, and three small stories underneath.
html
index.html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>The Daily Side Quest</title>
    <link rel="stylesheet" href="styles.css">
  </head>
  <body>
    <main class="newspaper-layout">  <!-- the grid container: its children get placed by the named areas in the css -->
      <header class="title">
        <p class="edition">Independent news for easily distracted citizens</p>
        <h1>The Daily Side Quest</h1>
        <p>November 4, 2026 · Vol. 01 · All the news that fits between tabs</p>
      </header>

      <article class="feature-article">
        <h2>Local Developer Opens One Tab, Somehow Acquires Forty-Seven</h2>
        <p>
          What began as a quick search for a CSS property became a sprawling
          investigation into typography, mechanical keyboards, and whether
          raccoons have hobbies. The original bug remains at large.
        </p>
      </article>

      <article class="secondary-article">
        <h2>Grid Finally Agrees to Put Things Where Asked</h2>
        <p>
          After tense negotiations, named grid areas have restored order to
          the newsroom. Officials credit three equal columns and a sensible
          gap. A rogue margin declined to comment.
        </p>
      </article>

      <figure class="cover-image">
        <img
          src="https://cdn.freecodecamp.org/curriculum/css-photo-gallery/1.jpg"
          alt="An orange-and-white cat lounging on a blanket"
        >
        <figcaption>Our editor in chief, taking another paid nap.</figcaption>
      </figure>

      <article class="small-article1">  <!-- the class name matches an area name in grid-template-areas (grid-area: small-article1) -->
        <h3>Coffee Files for Overtime</h3>
        <p>
          The newsroom's most dependable employee demands a larger mug
          and an end to the phrase “just one more fix.”
        </p>
      </article>

      <article class="small-article2">
        <h3>Semicolon Returns Home</h3>
        <p>
          A missing punctuation mark was found three lines above the error.
          Family members describe the reunion as painfully predictable.
        </p>
      </article>

      <article class="small-article3">
        <h3>Weather: Cloudy With Tabs</h3>
        <p>
          Expect scattered distractions throughout the afternoon, followed
          by a strong chance of actually shipping something.
        </p>
      </article>
    </main>
  </body>
</html>
css
styles.css
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 24px;
  color: #241e2b;
  background-color: #d8cbe3;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.6;
}

.newspaper-layout {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto 1fr 1fr 1fr;  /* auto = as tall as the content; 1fr = an equal share of the leftover height */
  grid-template-areas:  /* draws the layout as a picture: each string is a row, each word is a cell */
    "title title title"
    "feature-article feature-article cover-image"  /* repeat a name to span cells: feature-article spans 2 columns, cover-image continues down the next row */
    "secondary-article secondary-article cover-image"
    "small-article1 small-article2 small-article3";
  gap: 24px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px;
  border: 2px solid #241e2b;
  background-color: #fff5e8;
  box-shadow: 8px 8px 0 #241e2b;
}

.title {
  grid-area: title;  /* puts this element in the cell named title in grid-template-areas */
  padding-bottom: 20px;
  border-bottom: 5px double #241e2b;
  text-align: center;
}

.title h1 {
  margin: 8px 0;
  font-size: clamp(2rem, 5vw, 4.5rem);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.title p {
  margin: 0;
  font-size: 0.85rem;
}

.edition {
  font-family: Arial, sans-serif;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.feature-article {
  grid-area: feature-article;
}

.secondary-article {
  grid-area: secondary-article;
}

.cover-image {
  grid-area: cover-image;
  margin: 0;
}

.small-article1 {
  grid-area: small-article1;
}

.small-article2 {
  grid-area: small-article2;
}

.small-article3 {
  grid-area: small-article3;
}

article {
  min-width: 0;  /* lets a grid item shrink below its content's width, so long text can't force the column wider */
  border-top: 2px solid #241e2b;
  padding-top: 12px;
}

h2,
h3 {
  margin: 0 0 12px;
  line-height: 1.2;
}

h2 {
  font-size: 1.8rem;
}

h3 {
  font-size: 1.3rem;
}

article p {
  margin: 0;
}

.cover-image img {
  display: block;
  max-width: 100%;
  width: 100%;
  height: 85%;
  object-fit: cover;
  border: 1px solid #241e2b;
  filter: grayscale(100%);  /* grayscale() drains the color from the image; 100% = fully black and white */
}

figcaption {
  padding-top: 8px;
  font-size: 0.8rem;
  font-style: italic;
}
preview
▸ rwd cert project Build a Product Landing Page html + css
Learned ConceptsIntroduced: scroll-margin-top property • cursor property • iframe element (embedded video) • allowfullscreen attribute
Reinforced: position: fixed • z-index property • fragment links (href="#id") • display: flex • flex-wrap property • justify-content property • align-items property • gap property • aspect-ratio property • :focus-visible pseudo-class • outline-offset property • form, label for and input types • autocomplete attribute • required attribute • aria-label attribute • media queries (@media with max-width) • border-radius property • max-width • padding • box-sizing: border-box • universal selector (*)
a product landing page for my bedmixing set: a fixed header whose links scroll to each section (scroll-margin-top keeps headings clear of it), an embedded YouTube set, and an email sign-up form.
html
index.html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>bedmixing</title>
    <link rel="stylesheet" href="styles.css">
  </head>
  <body>
    <header id="header">
      <img
        id="header-img"
        src="https://guerz.lol/favicon-peach.png"
        alt="Guerz Logo"
      >
      <nav id="nav-bar" aria-label="Main navigation">
        <a class="nav-link" href="#features">Features</a>
        <a class="nav-link" href="#video-section">Watch</a>
        <a class="nav-link" href="#signup">Sign Up</a>
      </nav>
    </header>

    <main>
      <section id="hero">
        <h1>Guerz</h1>
        <p>))&lt;&gt;(( Back and Forth Forever and Ever</p>
      </section>

      <section id="features">
        <h2>Twitch VOD</h2>
        <div class="feature-list">
          <div class="feature">
            <h3>twitch.tv/guerz</h3>
            <p>Live Stream DJ Set</p>
          </div>
        </div>
      </section>

      <section id="video-section">
        <h2>Bedmixing</h2>
        <iframe
          id="video"
          src="https://www.youtube.com/embed/-4jzAhnYRsQ"
          title="Guerz: Bedmixing DJ set"
          allowfullscreen
        ></iframe>  <!-- iframe embeds another page (here a YouTube video) inside this one -->
      </section>

      <section id="signup">
        <h2>Get Guerz Updates</h2>
        <form
          id="form"
          action="https://www.freecodecamp.org/email-submit"
          method="post"
        >  <!-- the form sends its fields to the action url; method post puts them in the request body, not the url -->
          <label for="email">Email address</label>
          <input
            id="email"
            type="email"
            name="email"
            placeholder="Enter your email address"
            autocomplete="email"
            required
          >
          <input id="submit" type="submit" value="Sign Up">  <!-- type=submit makes a button that sends the form; value is its label -->
        </form>
      </section>
    </main>

    <footer id="footer">
      <p>Guerz - Bedmixing</p>
    </footer>
  </body>
</html>
css
styles.css
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, Helvetica, Arial, sans-serif;
  color: #1c1c1c;
  padding-top: 64px;  /* pushes the page down so the fixed header doesn't cover the hero */
}

#header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 64px;
  background-color: #1f2937;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 10;
}

#header-img{
  height: 36px;
}

#nav-bar {
  display: flex;
  gap: 20px;
}

.nav-link {
  color: #e5e7eb;
  text-decoration: none;
  font-size: 15px;
}

.nav-link:hover{
  color: #3882f6;
}

#hero {
  padding: 80px 24px;
  background-color: #f4f5f7;
  text-align: center;
}

#hero h1 {
  font-size: 2rem;
  max-width: 700px;
  margin: 0 auto 16px;
}

#hero p {
  font-size: 1.1rem;
  color: #4b5563;
  max-width: 600px;
  margin: 0 auto;
}

#features {
  padding: 60px 24px;
  text-align: center;
}

#features h2{
  margin-bottom: 32px;
}

.feature-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 32px;
}

.feature{
  max-width: 220px;
}
.feature h3{
  margin-bottom: 8px;
}

#video-section {
  padding: 60px 24px;
  background-color: #1f2937;
  color: #e5e7eb;
  text-align: center;
}

#video {
  width: 100%;
  max-width: 640px;
  height: 360px;
  border: none;
  margin-top: 20px;
}

#signup {
  padding: 60px 24px;
  text-align: center;
}

#form {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
}

#email {
  padding: 10px 14px;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  min-width: 260px;
}

#submit {
  padding: 10px 20px;
  font-size: 1rem;
  background-color: #3882f6;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;  /* pointer = the hand cursor, a hint that the button is clickable */
}

#footer {
  padding: 24px;
  text-align: center;
  background-color: #1f2937;
  color: #e5e7eb;
}

@media (max-width: 600px) {
  #hero h1{
  font-size: 1.5rem;
}
  #nav-bar{
  gap: 12px;
}
  .nav-link{
  font-size: 13px;
}
  #video{
  height: 220px;
}
}

section {
  scroll-margin-top: 80px;  /* when a nav link jumps to a section, it stops 80px early so the fixed header doesn't cover the heading */
}

#form {
  align-items: center;
}

#email {
  max-width: 100%;
  min-width: 0;
}

#video {
  aspect-ratio: 16 / 9;
  height: auto;
}

.nav-link:focus-visible,
#email:focus-visible,
#submit:focus-visible {
  outline: 3px solid #e5a989;
  outline-offset: 4px;
}
preview
▸ CSS Animations 4 items · 4 built
▸ rwd workshop Build an Animated Ferris Wheel html + css
Learned ConceptsIntroduced: @keyframes rule • animation-name property • animation-duration property • animation-iteration-count property (infinite) • animation-timing-function property (linear, ease-in-out) • animation shorthand property • keyframe percentages (0%, 25%, 100%) • transform-origin property • animating background-color
Reinforced: transform: rotate() • :nth-of-type() pseudo-class • position: absolute • border-radius property • border property • vw unit • max-width and max-height • percentage width and height • background-color • margin-left
a ferris wheel built from spans and divs: the whole wheel turns with one @keyframes rotation, and each cabin runs its own animation that counter-rotates so it stays upright while its background-color cycles.
html
index.html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <title>Build an Animated Ferris Wheel</title>
    <link rel="stylesheet" href="./styles.css">
  </head>
  <body>
    <div class="wheel">
      <span class="line"></span>  <!-- empty on purpose: the css draws each spoke as a thin bar and rotates it around the wheel's center -->
      <span class="line"></span>
      <span class="line"></span>
      <span class="line"></span>
      <span class="line"></span>
      <span class="line"></span>

      <div class="cabin"></div>
      <div class="cabin"></div>
      <div class="cabin"></div>
      <div class="cabin"></div>
      <div class="cabin"></div>
      <div class="cabin"></div>
    </div>
  </body>
</html>
css
styles.css
.wheel {
  border: 2px solid black;
  border-radius: 50%;
  margin-left: 50px;
  position: absolute;
  height: 55vw;
  width: 55vw;
  max-width: 500px;
  max-height: 500px;
  animation-name: wheel;  /* names the @keyframes block to play (the @keyframes wheel rule at the bottom) */
  animation-duration: 10s;  /* one full cycle takes 10 seconds */
  animation-iteration-count: infinite;  /* infinite = repeat forever instead of stopping after one cycle */
  animation-timing-function: linear;  /* linear = the same speed the whole way, so the wheel turns steadily */
}

.line {
  background-color: black;
  width: 50%;
  height: 2px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform-origin: 0% 0%;  /* the point an element rotates around: 0% 0% is its top-left corner, so each spoke pivots from the wheel's center */
}

.line:nth-of-type(2) {
  transform: rotate(60deg);
}

.line:nth-of-type(3) {
  transform: rotate(120deg);
}

.line:nth-of-type(4) {
  transform: rotate(180deg);
}

.line:nth-of-type(5) {
  transform: rotate(240deg);
}

.line:nth-of-type(6) {
  transform: rotate(300deg);
}

.cabin {
  background-color: red;
  width: 20%;
  height: 20%;
  position: absolute;
  border: 2px solid;
  transform-origin: 50% 0%;
  animation: cabins 10s ease-in-out infinite;  /* animation shorthand: name, duration, timing function and iteration count in one line; ease-in-out = slow start, slow end */
}

.cabin:nth-of-type(1) {
  right: -8.5%;
  top: 50%;
}

.cabin:nth-of-type(2) {
  right: 17%;
  top: 93.5%;
}

.cabin:nth-of-type(3) {
  right: 67%;
  top: 93.5%;
}

.cabin:nth-of-type(4) {
  left: -8.5%;
  top: 50%;
}

.cabin:nth-of-type(5) {
  left: 17%;
  top: 7%;
}

.cabin:nth-of-type(6) {
  right: 17%;
  top: 7%;
}

@keyframes wheel {  /* @keyframes defines the animation: which styles the element has at each point from 0% to 100% */
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes cabins {
  0% {
    transform: rotate(0deg);
  }
  25% {  /* a percentage is a step along the timeline; the browser blends between steps (here red fades to yellow) */
    background-color: yellow;
  }
  50% {
    background-color: purple;
  }
  75% {
    background-color: yellow;
  }

  100% {
    transform: rotate(-360deg);  /* spins the cabin the opposite way to the wheel, so the cabins stay upright */
  }
}
preview
▸ rwd lab Build a Moon Orbit html + css
Learned ConceptsIntroduced: ellipse shape for radial-gradient() • inset box-shadow • chaining transform functions (rotate + translate)
Reinforced: @keyframes rule • animation shorthand property • linear timing • infinite iteration • transform-origin property • translate(-50%, -50%) centering • radial-gradient() function • box-shadow property • 8-digit hex colors with alpha • border-radius property • position: absolute • position: relative • role="img" with aria-label • display: flex centering • vh unit • box-sizing: border-box • universal selector (*) • viewport meta tag
a moon circling a planet: the orbit ring rotates with a @keyframes animation, so the moon riding on its edge travels the circle, and the inset box-shadow plus radial-gradient give both bodies a lit side and a shadow side.
html
index.html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Build a Moon Orbit</title>
    <link rel="stylesheet" href="styles.css">
  </head>
  <body>
    <div class="space" role="img" aria-label="The Moon orbiting Earth">
      <div class="earth"></div>
      <div class="orbit">  <!-- the orbit is the ring that spins; the moon sits on its edge, so it travels around Earth as the ring turns -->
        <div class="moon"></div>
      </div>
    </div>
  </body>
</html>
css
styles.css
* {
  box-sizing: border-box;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  margin: 0;
  background-color: #100f1c;
  background-image: radial-gradient(
    ellipse at center,  /* ellipse (instead of circle) stretches the glow to fit the box's shape */
    #302740 0%,
    #100f1c 70%
  );
}

.space {
  position: relative;
  width: 200px;
  height: 200px;
}

.earth {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100px;
  height: 100px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background-color: #8274b0;
  background-image: radial-gradient(
    circle at 30% 30%,
    #edb598 0%,
    #a28abf 35%,
    #494164 75%
  );
  box-shadow:
    inset -12px -8px 20px #211b3d,  /* inset = the shadow is drawn inside the shape, which darkens one side of the planet */
    0 0 35px #a28abf55;
}

.orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200px;
  height: 200px;
  transform: translate(-50%, -50%);
  transform-origin: 0 0;
  border: 1px solid #b6a4cd44;
  border-radius: 50%;
  animation: orbit 5s linear infinite;
}

.moon {
  position: absolute;
  top: 0;
  left: 50%;
  width: 30px;
  height: 30px;
  transform: translateX(-50%);
  border-radius: 50%;
  background-color: #edb598;
  box-shadow:
    inset -6px -4px 8px #936d77,
    0 0 15px #edb59844;
}

@keyframes orbit {
  0% {
    transform: rotate(0deg) translate(-50%, -50%);  /* two transform functions chained in one value; the animation replaces the element's transform, so translate is repeated here to keep the orbit centered while rotate spins it */
  }

  100% {
    transform: rotate(360deg) translate(-50%, -50%);
  }
}
preview
▸ rwd workshop Build a Flappy Penguin html + css
Learned ConceptsIntroduced: transform: scaleX(-1) to flip an element • @keyframes with only some steps (no 0% or 100%) • opacity property (percentage) • rgb() color function • emoji as page content
Reinforced: custom properties and var() • transform: scale(), skew() and rotate() • transition property • :active pseudo-class • cursor property • z-index property • border-radius property • linear-gradient() function • calc() function • overflow property • font shorthand • compound class selectors • universal selector (*) • ::before pseudo-element • margin: auto centering • transform-origin property • animation shorthand property
a penguin made of divs that waves with a @keyframes animation: the wave only defines the middle steps, so the browser fills in the start and end from the element's own styles, and a scaleX(-1) mirrors the second wing.
html
index.html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <link rel="stylesheet" href="./styles.css" />
    <title>Build a Flappy Penguin</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  </head>

  <body>
    <div class="left-mountain"></div>
    <div class="back-mountain"></div>
    <div class="sun"></div>
    <div class="penguin">
      <div class="penguin-head">
        <div class="face left"></div>
        <div class="face right"></div>
        <div class="chin"></div>
        <div class="eye left">
          <div class="eye-lid"></div>
        </div>
        <div class="eye right">
          <div class="eye-lid"></div>
        </div>
        <div class="blush left"></div>
        <div class="blush right"></div>
        <div class="beak top"></div>
        <div class="beak bottom"></div>
      </div>
      <div class="shirt">
        <div>💜</div>  <!-- an emoji is just a text character, so it can go straight into the html -->
        <p>I CSS</p>
      </div> 
      <div class="penguin-body">
        <div class="arm left"></div>
        <div class="arm right"></div>
        <div class="foot left"></div>
        <div class="foot right"></div>
      </div>
    </div>

    <div class="ground"></div>
  </body>
</html>
css
styles.css
:root {
  --penguin-face: white;
  --penguin-picorna: orange;
  --penguin-skin: gray;
}

body {
  background: linear-gradient(45deg, rgb(118, 201, 255), rgb(247, 255, 222));  /* rgb(red, green, blue) sets a color with three channel values from 0 to 255 */
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.left-mountain {
  width: 300px;
  height: 300px;
  background: linear-gradient(rgb(203, 241, 228), rgb(80, 183, 255));
  position: absolute;
  transform: skew(0deg, 44deg);
  z-index: 2;
  margin-top: 100px;
}

.back-mountain {
  width: 300px;
  height: 300px;
  background: linear-gradient(rgb(203, 241, 228), rgb(47, 170, 255));
  position: absolute;
  z-index: 1;
  transform: rotate(45deg);
  left: 110px;
  top: 225px;
}

.sun {
  width: 200px;
  height: 200px;
  background-color: yellow;
  position: absolute;
  border-radius: 50%;
  top: -75px;
  right: -75px;
}

.penguin {
  width: 300px;
  height: 300px;
  margin: auto;
  margin-top: 75px;
  z-index: 4;
  position: relative;
  transition: transform 1s ease-in-out 0ms;
}

.penguin * {
  position: absolute;
}

.penguin:active {
  transform: scale(1.5);
  cursor: not-allowed;
}

.penguin-head {
  width: 50%;
  height: 45%;
  background: linear-gradient(
    45deg,
    var(--penguin-skin),
    rgb(239, 240, 228)
  );
  border-radius: 70% 70% 65% 65%;
  top: 10%;
  left: 25%;
  z-index: 1;
}

.face {
  width: 60%;
  height: 70%;
  background-color: var(--penguin-face);
  border-radius: 70% 70% 60% 60%;
  top: 15%;
}

.face.left {
  left: 5%;
}

.face.right {
  right: 5%;
}

.chin {
  width: 90%;
  height: 70%;
  background-color: var(--penguin-face);
  top: 25%;
  left: 5%;
  border-radius: 70% 70% 100% 100%;
}

.eye {
  width: 15%;
  height: 17%;
  background-color: black;
  top: 45%;
  border-radius: 50%;
}

.eye.left {
  left: 25%;
}

.eye.right {
  right: 25%;
}

.eye-lid {
  width: 150%;
  height: 100%;
  background-color: var(--penguin-face);
  top: 25%;
  left: -23%;
  border-radius: 50%;
}

.blush {
  width: 15%;
  height: 10%;
  background-color: pink;
  top: 65%;
  border-radius: 50%;
}

.blush.left {
  left: 15%;
}

.blush.right {
  right: 15%;
}

.beak {
  height: 10%;
  background-color: var(--penguin-picorna);
  border-radius: 50%;
}

.beak.top {
  width: 20%;
  top: 60%;
  left: 40%;
}

.beak.bottom {
  width: 16%;
  top: 65%;
  left: 42%;
}

.shirt {
  font: bold 25px Helvetica, sans-serif;
  top: 165px;
  left: 127.5px;
  z-index: 1;
  color: #6a6969;
}

.shirt div {
  font-weight: initial;
  top: 22.5px;
  left: 12px;
}

.penguin-body {
  width: 53%;
  height: 45%;
  background: linear-gradient(
    45deg,
    rgb(134, 133, 133) 0%,
    rgb(234, 231, 231) 25%,
    white 67%
  );
  border-radius: 80% 80% 100% 100%;
  top: 40%;
  left: 23.5%;
}

.penguin-body::before {
  content: "";
  position: absolute;
  width: 50%;
  height: 45%;
  background-color: var(--penguin-skin);
  top: 10%;
  left: 25%;
  border-radius: 0% 0% 100% 100%;
  opacity: 70%;  /* opacity: 0 is invisible and 100% is solid; 70% lets whatever is behind show through */
}

.arm {
  width: 30%;
  height: 60%;
  background: linear-gradient(
    90deg,
    var(--penguin-skin),
    rgb(209, 210, 199)
  );
  border-radius: 30% 30% 30% 120%;
  z-index: -1;
}

.arm.left {
  top: 35%;
  left: 5%;
  transform-origin: top left;
  transform: rotate(130deg) scaleX(-1);  /* scaleX(-1) flips the element horizontally, like a mirror image */
  animation: 3s linear infinite wave;
}

.arm.right {
  top: 0%;
  right: -5%;
  transform: rotate(-45deg);
}

@keyframes wave {  /* no 0% or 100% step: the browser uses the arm's normal transform for those, so it waves for the first 40% of each cycle, then rests */
  10% {
    transform: rotate(110deg) scaleX(-1);
  }
  20% {
    transform: rotate(130deg) scaleX(-1);
  }
  30% {
    transform: rotate(110deg) scaleX(-1);
  }
  40% {
    transform: rotate(130deg) scaleX(-1);
  }
}

.foot {
  width: 15%;
  height: 30%;
  background-color: var(--penguin-picorna);
  top: 85%;
  border-radius: 50%;
  z-index: -1;
}

.foot.left {
  left: 25%;
  transform: rotate(80deg);
}

.foot.right {
  right: 25%;
  transform: rotate(-80deg);
}

.ground {
  width: 100vw;
  height: calc(100vh - 300px);
  background: linear-gradient(90deg, rgb(88, 175, 236), rgb(182, 255, 255));
  z-index: 3;
  position: absolute;
  margin-top: -58px;
}
preview
▸ rwd lab Build a Personal Portfolio html + css
Learned ConceptsIntroduced: target="_blank" attribute • text-decoration: none • footer element
Reinforced: position: fixed • z-index property • flex properties (display, justify-content, align-items, flex-direction, flex-wrap) • gap property • list-style: none • :hover pseudo-class • linear-gradient() function • border-radius property • overflow property • media queries (@media with max-width) • fragment links (href="#id") • rem unit • vh unit • id selectors • box-sizing: border-box
my own portfolio page: a fixed navbar with fragment links, a full-height welcome gradient, a flex-wrapped grid of project tiles that open in a new tab, a contact button, and a footer.
html
index.html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Build a Personal Portfolio</title>
  <link rel="stylesheet" href="styles.css">
</head>
<body>
  <nav id="navbar">
    <div class="nav-logo">guerz.lol</div>
    <ul class="nav-links">
      <li><a href="#welcome-section">Home</a></li>
      <li><a href="#project-section">Projects</a></li>
      <li><a href="#contact">Contact</a></li>
    </ul>
  </nav>
  <section id="welcome-section">
    <h1>Oh, Hey, I am Guerz.</h1>
    <p>It's pronounced: "Guerz".</p>
  </section>
  <section id="project-section">
    <h2>Stuff I've built</h2>
    <div class="projects-grid">
      <a href="https://guerz.lol" target="_blank" class="project-tile">  <!-- target="_blank" opens the link in a new browser tab -->
        <div class="project-thumb"></div>
        <p class="project-title">guerz.lol</p>
      </a>
      <a href="https://twitch.tv/guerz" target="_blank" class="project-tile">
        <div class="project-thumb"></div>
        <p class="project-title">ttv/guerz</p>
      </a>
      <a href="https://builds.guerz.lol" target="_blank" class="project-tile">
        <div class="project-thumb"></div>
        <p class="project-title">fCC cert projects</p>
      </a>
    </div>
  </section>
  <section id="contact">
    <h2>Find me elsewhere</h2>
    <p>Come hang in the stream or poke around the code.</p>
    <a id="profile-link" href="https://github.com/gitguerz" target="_blank">GitHub</a>
  </section>
  <footer>  <!-- footer = the closing section of the page, usually credits or contact info -->
    <p>Built by Guerz — {decompress} · guerz.lol</p>
  </footer>
</body>
</html>
css
styles.css
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, Helvetica, Arial, sans-serif;
  color: #e5e7eb;
  background-color: #111827;
}

#navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background-color: #1f2937;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 10;
}

.nav-logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: #f9fafb;
}

.nav-links {
  display: flex;
  gap: 20px;
  list-style: none;
}

.nav-links a {
  color: #e5e7eb;
  text-decoration: none;  /* removes the default underline from links */
}

.nav-links a:hover { color: #a78bfa; }

#welcome-section {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0 24px;
  background: linear-gradient(135deg, #1f2937 0%, #4c1d95 100%);
}

#welcome-section h1 {
  font-size: 3rem;
  margin-bottom: 12px;
}

#welcome-section p {
  font-size: 1.2rem;
  color: #c4b5fd;
}

#project-section {
  padding: 80px 24px;
  text-align: center;
}

#project-section h2 {
  font-size: 2rem;
  margin-bottom: 40px;
}

.projects-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
}

.project-tile {
  width: 260px;
  background-color: #1f2937;
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: #e5e7eb;
}

.project-thumb {
  height: 150px;
  background: linear-gradient(135deg, #4c1d95 0%, #a78bfa 100%);
}

.project-title {
  padding: 14px;
  font-weight: 600;
}

#contact {
  padding: 80px 24px;
  text-align: center;
  background-color: #0f1420;
}

#contact h2 {
  font-size: 2rem;
  margin-bottom: 12px;
}

#profile-link {
  display: inline-block;
  margin-top: 20px;
  padding: 12px 28px;
  background-color: #7c3aed;
  color: white;
  text-decoration: none;
  border-radius: 6px;
}

footer {
  padding: 24px;
  text-align: center;
  background-color: #1f2937;
  color: #9ca3af;
}

@media (max-width: 600px) {
  #welcome-section h1 { font-size: 2rem; }
  .nav-links { gap: 12px; }
  .nav-logo { font-size: 0.95rem; }
}
preview
▸ Legacy Responsive Web Design V8 20 built · 20 total · fCC's order
▸ V8 Courses + Certification Projects 20 items · 20 built

↗ fCC's legacy Responsive Web Design (V8) curriculum

▸ legacy rwd v8 Learn HTML by Building a Cat Photo App html
Concepts Learnedh1 · h2 · h3 · p · a · href · target="_blank" · img · src · alt · ul · ol · li · figure · figcaption · em · strong · main · section · form · action · fieldset · legend · input · radio · checkbox · text · name · value · checked · placeholder · required · label · for · id · button · submit
html
index.html
<html>
  <body>
    <main>
      <h1>CatPhotoApp</h1>
      <section>
        <h2>Cat Photos</h2>
        <p>Everyone loves <a href="https://cdn.freecodecamp.org/curriculum/cat-photo-app/running-cats.jpg">cute cats</a> online!</p>
        <p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
        <a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
      </section>
      <section>
        <h2>Cat Lists</h2>
        <h3>Things cats love:</h3>
        <ul>
          <li>catnip</li>
          <li>laser pointers</li>
          <li>lasagna</li>
        </ul>
        <figure>
          <img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/lasagna.jpg" alt="A slice of lasagna on a plate.">
          <figcaption>Cats <em>love</em> lasagna.</figcaption>  
        </figure>
        <h3>Top 3 things cats hate:</h3>
        <ol>
          <li>flea treatment</li>
          <li>thunder</li>
          <li>other cats</li>
        </ol>
        <figure>
          <img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/cats.jpg" alt="Two tabby kittens sleeping together on a couch.">
          <figcaption>Cats <strong>hate</strong> other cats.</figcaption>  
        </figure>
      </section>
      <section>
        <h2>Cat Form</h2>
        <form action="https://freecatphotoapp.com/submit-cat-photo">
          <fieldset>
            <legend>Is your cat an indoor or outdoor cat?</legend>
            <label><input id="indoor" type="radio" name="indoor-outdoor" value="indoor" checked> Indoor</label>
            <label><input id="outdoor" type="radio" name="indoor-outdoor" value="outdoor"> Outdoor</label>
          </fieldset>
          <fieldset>
            <legend>What's your cat's personality?</legend>
            <input id="loving" type="checkbox" name="personality" value="loving" checked> <label for="loving">Loving</label>
            <input id="lazy" type="checkbox" name="personality" value="lazy"> <label for="lazy">Lazy</label>
            <input id="energetic" type="checkbox" name="personality" value="energetic"> <label for="energetic"> Energetic</label>
          </fieldset>
          <input type="text" name="catphotourl" placeholder="cat photo URL" required>
          <button type="submit">Submit</button>
        </form>
      </section>
    </main>
  </body>
</html>
preview
▸ legacy rwd v8 Learn Basic CSS by Building a Cafe Menu html + css
Concepts LearnedHTML: link · rel="stylesheet" · class · div · hr · article · footer · viewport meta · CSS: background-image · url() · font-family · font-size · font-style · text-align · width · max-width · background-color · margin · auto margins · padding · display · block · inline-block · height · border-color · comma selectors · class selectors · descendant selectors · a:visited · a:hover · a:active
html
index.html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Cafe Menu</title>
    <link href="styles.css" rel="stylesheet"/>
  </head>
  <body>
    <div class="menu">
      <main>
        <h1>CAMPER CAFE</h1>
        <p class="established">Est. 2020</p>
        <hr>
        <section>
          <h2>Coffee</h2>
          <img src="https://cdn.freecodecamp.org/curriculum/css-cafe/coffee.jpg" alt="coffee icon"/>
          <article class="item">
            <p class="flavor">French Vanilla</p><p class="price">3.00</p>
          </article>
          <article class="item">
            <p class="flavor">Caramel Macchiato</p><p class="price">3.75</p>
          </article>
          <article class="item">
            <p class="flavor">Pumpkin Spice</p><p class="price">3.50</p>
          </article>
          <article class="item">
            <p class="flavor">Hazelnut</p><p class="price">4.00</p>
          </article>
          <article class="item">
            <p class="flavor">Mocha</p><p class="price">4.50</p>
          </article>
        </section>
        <section>
          <h2>Desserts</h2>
          <img src="https://cdn.freecodecamp.org/curriculum/css-cafe/pie.jpg" alt="pie icon"/>
          <article class="item">
            <p class="dessert">Donut</p><p class="price">1.50</p>
          </article>
          <article class="item">
            <p class="dessert">Cherry Pie</p><p class="price">2.75</p>
          </article>
          <article class="item">
            <p class="dessert">Cheesecake</p><p class="price">3.00</p>
          </article>
          <article class="item">
            <p class="dessert">Cinnamon Roll</p><p class="price">2.50</p>
          </article>
        </section>
      </main>
      <hr class="bottom-line">
      <footer>
        <p>
          <a href="https://www.freecodecamp.org" target="_blank">Visit our website</a>
        </p>
        <p class="address">123 Free Code Camp Drive</p>
      </footer>
    </div>
  </body>
</html>
css
styles.css
body {
  background-image: url(https://cdn.freecodecamp.org/curriculum/css-cafe/beans.jpg);
  font-family: sans-serif;
  padding: 20px;
}

h1 {
  font-size: 40px;
  margin-top: 0;
  margin-bottom: 15px;
}

h2 {
  font-size: 30px;
}

.established {
  font-style: italic;
}

h1, h2, p {
  text-align: center;
}

.menu {
  width: 80%;
  background-color: burlywood;
  margin-left: auto;
  margin-right: auto;
  padding: 20px;
  max-width: 500px;
}

img {
  display: block;
  margin-left: auto;
  margin-right: auto;
  margin-top: -25px;
}

hr {
  height: 2px;
  background-color: brown;
  border-color: brown;
}

.bottom-line {
  margin-top: 25px;
}

h1, h2 {
  font-family: Impact, serif;
}

.item p {
  display: inline-block;
  margin-top: 5px;
  margin-bottom: 5px;
  font-size: 18px;
}

.flavor, .dessert {
  text-align: left;
  width: 75%;
}

.price {
  text-align: right;
  width: 25%;
}

/* FOOTER */

footer {
  font-size: 14px;
}

.address {
  margin-bottom: 5px;
}

a {
  color: black;
}

a:visited {
  color: black;
}

a:hover {
  color: brown;
}

a:active {
  color: brown;
}
preview
▸ legacy rwd v8 Learn CSS Colors by Building a Set of Colored Markers html + css
Concepts LearnedHTML: multiple classes on one element · CSS: rgb() · rgba() · hex colors · 8-digit hex (alpha) · hsl() · hsla() · alpha channel · linear-gradient() · box-shadow · border-left · double border · background shorthand · padding shorthand · margin: auto · display: inline-block · comma selectors
html
index.html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Colored Markers</title>
    <link rel="stylesheet" href="styles.css">
  </head>
  <body>
    <h1>CSS Color Markers</h1>
    <div class="container">
      <div class="marker red">
        <div class="cap"></div>
        <div class="sleeve"></div>
      </div>
      <div class="marker green">
        <div class="cap"></div>
        <div class="sleeve"></div>
      </div>
      <div class="marker blue">
        <div class="cap"></div>
        <div class="sleeve"></div>
      </div>
    </div>
  </body>
</html>
css
styles.css
h1 {
  text-align: center;
}

.container {
  background-color: rgb(255, 255, 255);
  padding: 10px 0;
}

.marker {
  width: 200px;
  height: 25px;
  margin: 10px auto;
}

.cap {
  width: 60px;
  height: 25px;
}

.sleeve {
  width: 110px;
  height: 25px;
  background-color: rgba(255, 255, 255, 0.5);
  border-left: 10px double rgba(0, 0, 0, 0.75);
}

.cap, .sleeve {
  display: inline-block;
}

.red {
  background: linear-gradient(rgb(122, 74, 14), rgb(245, 62, 113), rgb(162, 27, 27));
  box-shadow: 0 0 20px 0 rgba(83, 14, 14, 0.8);
}

.green {
  background: linear-gradient(#55680D, #71F53E, #116C31);
  box-shadow: 0 0 20px 0 #3B7E20CC;
}

.blue {
  background: linear-gradient(hsl(186, 76%, 16%), hsl(223, 90%, 60%), hsl(240, 56%, 42%));
  box-shadow: 0 0 20px 0 hsla(223, 59%, 31%, 0.8);
}
preview
▸ legacy rwd v8 Learn HTML Forms by Building a Registration Form html + css
Concepts LearnedHTML: form · method · action · fieldset · legend · label · for · input · text · email · password · pattern · radio · checkbox · file · number · min · max · submit · value · select · option · textarea · rows · cols · placeholder · required · checked · name · id · class · CSS: vh · vw · em · rem · min-width · max-width · min-height · margin shorthand · padding shorthand · border shorthand · border-bottom · :last-of-type · attribute selector · unset · vertical-align · display: block
html
index.html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <title>Registration Form</title>
    <link rel="stylesheet" href="styles.css" />
  </head>
  <body>
    <h1>Registration Form</h1>
    <p>Please fill out this form with the required information</p>
    <form method="post" action='https://register-demo.freecodecamp.org'>
      <fieldset>
        <label for="first-name">Enter Your First Name: <input id="first-name" name="first-name" type="text" required /></label>
        <label for="last-name">Enter Your Last Name: <input id="last-name" name="last-name" type="text" required /></label>
        <label for="email">Enter Your Email: <input id="email" name="email" type="email" required /></label>
        <label for="new-password">Create a New Password: <input id="new-password" name="new-password" type="password" pattern="[a-z0-5]{8,}" required /></label>
      </fieldset>
      <fieldset>
        <legend>Account type (required)</legend>
        <label for="personal-account"><input id="personal-account" type="radio" name="account-type" class="inline" checked /> Personal</label>
        <label for="business-account"><input id="business-account" type="radio" name="account-type" class="inline" /> Business</label>
      </fieldset>
      <fieldset>
        <label for="profile-picture">Upload a profile picture: <input id="profile-picture" type="file" name="file" /></label>
        <label for="age">Input your age (years): <input id="age" type="number" name="age" min="13" max="120" /></label>
        <label for="referrer">How did you hear about us?
          <select id="referrer" name="referrer">
            <option value="">(select one)</option>
            <option value="1">freeCodeCamp News</option>
            <option value="2">freeCodeCamp YouTube Channel</option>
            <option value="3">freeCodeCamp Forum</option>
            <option value="4">Other</option>
          </select>
        </label>
        <label for="bio">Provide a bio:
          <textarea id="bio" name="bio" rows="3" cols="30" placeholder="I like coding on the beach..."></textarea>
        </label>
      </fieldset>
      <label for="terms-and-conditions">
        <input class="inline" id="terms-and-conditions" type="checkbox" required name="terms-and-conditions" /> I accept the <a href="https://www.freecodecamp.org/news/terms-of-service/">terms and conditions</a>
      </label>
      <input type="submit" value="Submit" />
    </form>
  </body>
</html>
css
styles.css
body {
  width: 100%;
  height: 100vh;
  margin: 0;
  background-color: #1b1b32;
  color: #f5f6f7;
  font-family: Tahoma;
  font-size: 16px;
}

h1, p {
  margin: 1em auto;
  text-align: center;
}

form {
  width: 60vw;
  max-width: 500px;
  min-width: 300px;
  margin: 0 auto;
  padding-bottom: 2em;
}

fieldset {
  border: none;
  padding: 2rem 0;
  border-bottom: 3px solid #3b3b4f;
}

fieldset:last-of-type {
  border-bottom: none;
}

label {
  display: block;
  margin: 0.5rem 0;
}

input,
textarea,
select {
  margin: 10px 0 0 0;
  width: 100%;
  min-height: 2em;
}

input, textarea {
  background-color: #0a0a23;
  border: 1px solid #0a0a23;
  color: #ffffff;
}

.inline {
  width: unset;
  margin: 0 0.5em 0 0;
  vertical-align: middle;
}

input[type="submit"] {
  display: block;
  width: 60%;
  margin: 1em auto;
  height: 2em;
  font-size: 1.1rem;
  background-color: #3b3b4f;
  border-color: white;
  min-width: 300px;
}

input[type="file"] {
  padding: 1px 2px;
}

a {
  color: #dfdfe2;
}
preview
▸ legacy cert project Build a Survey Form html
Concepts Learnedform · id attribute · label · for · input · text · email · number · min · max · placeholder · required · select · option · disabled · selected · fieldset · legend · radio · checkbox · value · textarea · button · submit · shared name for radio groups
html
index.html

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8"> <!-- sets character encoding so special chars render right -->
  <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- makes the page scale right on mobile -->
  <title>Survey Form</title> <!-- browser tab title -->
  <link rel="stylesheet" href="styles.css"> <!-- links your CSS file, required by the test note -->
</head>
<body>

  <h1 id="title">freeCodeCamp Survey Form</h1> <!-- required: h1, id="title" -->
  <p id="description">Thanks for taking the time to help us improve the platform</p> <!-- required: p, id="description" -->

  <form id="survey-form"> <!-- required: form, id="survey-form", everything below lives inside it -->

    <label id="name-label" for="name">Name <!-- required id="name-label"; "for" ties the label to the input -->
      <input id="name" type="text" placeholder="Enter your name" required> <!-- type="text", placeholder, required -->
    </label>

    <label id="email-label" for="email">Email <!-- required id="email-label" -->
      <input id="email" type="email" placeholder="Enter your email" required> <!-- type="email" gives free HTML5 validation -->
    </label>

    <label id="number-label" for="number">Age <!-- required id="number-label" -->
      <input id="number" type="number" min="1" max="120" placeholder="Age in years" required> <!-- min/max required, type="number" blocks non-numbers -->
    </label>

    <label for="dropdown">Which option best describes your current role?
      <select id="dropdown"> <!-- required id="dropdown", needs 2+ selectable options -->
        <option value="" disabled selected>Select an option</option> <!-- disabled so it doesn't count toward the "2 selectable" requirement -->
        <option value="student">Student</option>
        <option value="dev">Full Time Developer</option>
        <option value="hobby">Hobbyist</option>
      </select>
    </label>

    <fieldset> <!-- groups related radios visually and semantically -->
      <legend>How did you hear about freeCodeCamp?</legend>
      <label><input type="radio" name="referrer" value="search"> Search</label> <!-- radios in a group share the same name -->
      <label><input type="radio" name="referrer" value="friend"> Friend</label>
      <label><input type="radio" name="referrer" value="other"> Other</label>
    </fieldset>

    <fieldset>
      <legend>What would you like to see improved?</legend>
      <label><input type="checkbox" value="frontend"> Front-end projects</label> <!-- each checkbox just needs a value attr -->
      <label><input type="checkbox" value="backend"> Back-end projects</label>
      <label><input type="checkbox" value="data"> Data visualization</label>
    </fieldset>

    <label for="comments">Any comments or suggestions?
      <textarea id="comments" placeholder="Enter your comment here"></textarea> <!-- any textarea satisfies the test -->
    </label>

    <button id="submit" type="submit">Submit</button> <!-- required id="submit", type="submit" -->

  </form>

</body>
</html>
preview
▸ legacy rwd v8 Learn the CSS Box Model by Building a Rothko Painting html + css
Concepts LearnedHTML: div · class · nesting · CSS: box model · width · height · border · padding · margin · margin: auto · overflow · background-color · box-shadow · border-radius · transform · rotate() · filter · blur() · percentage sizes · selector list
html
index.html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <title>Rothko Painting</title>
    <link href="./styles.css" rel="stylesheet">
  </head>
  <body>
    <div class="frame">
      <div class="canvas">
        <div class="one"></div>
        <div class="two"></div>
        <div class="three"></div>
      </div>
    </div>
  </body>
</html>
css
styles.css
.canvas {
  width: 500px;
  height: 600px;
  background-color: #4d0f00;
  overflow: hidden;
  filter: blur(2px);
}

.frame {
  border: 50px solid black;
  width: 500px;
  padding: 50px;
  margin: 20px auto;
}

.one {
  width: 425px;
  height: 150px;
  background-color: #efb762;
  margin: 20px auto;
  box-shadow: 0 0 3px 3px #efb762;
  border-radius: 9px;
  transform: rotate(-0.6deg);
}

.two {
  width: 475px;
  height: 200px;
  background-color: #8f0401;
  margin: 0 auto 20px;
  box-shadow: 0 0 3px 3px #8f0401;
  border-radius: 8px 10px;
  transform: rotate(0.4deg);
}

.one, .two {
  filter: blur(1px);
}

.three {
  width: 91%;
  height: 28%;
  background-color: #b20403;
  margin: auto;
  filter: blur(2px);
  box-shadow: 0 0 5px 5px #b20403;
  border-radius: 30px 25px 60px 12px;
  transform: rotate(-0.2deg)
}
preview
▸ legacy rwd v8 Learn CSS Flexbox by Building a Photo Gallery html + css
Concepts LearnedHTML: header · h1 · div · img · alt · class · CSS: flexbox · display: flex · flex-direction · flex-wrap · justify-content · align-items · gap · box-sizing: border-box · universal selector · descendant selector · max-width · margin: auto · object-fit · border-radius · text-transform · ::after · content
html
index.html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Photo Gallery</title>
    <link rel="stylesheet" href="./styles.css">
  </head>
  <body>
    <header class="header">
      <h1>css flexbox photo gallery</h1>
    </header>
    <div class="gallery">
      <img src="https://cdn.freecodecamp.org/curriculum/css-photo-gallery/1.jpg" alt="cat-leaf">
      <img src="https://cdn.freecodecamp.org/curriculum/css-photo-gallery/2.jpg" alt="stretchy">
      <img src="https://cdn.freecodecamp.org/curriculum/css-photo-gallery/3.jpg" alt="looking-cat">
      <img src="https://cdn.freecodecamp.org/curriculum/css-photo-gallery/4.jpg" alt="cat-mlem">
      <img src="https://cdn.freecodecamp.org/curriculum/css-photo-gallery/5.jpg" alt="cat-basket">
      <img src="https://cdn.freecodecamp.org/curriculum/css-photo-gallery/6.jpg" alt="sleepy-cat">
      <img src="https://cdn.freecodecamp.org/curriculum/css-photo-gallery/7.jpg" alt="pale-cat">
      <img src="https://cdn.freecodecamp.org/curriculum/css-photo-gallery/8.jpg" alt="peak-a-cat">
      <img src="https://cdn.freecodecamp.org/curriculum/css-photo-gallery/9.jpg" alt="cat-derp">
    </div>
  </body>
</html>
css
styles.css
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: sans-serif;
  background: #f5f6f7;
}

.header {
  text-align: center;
  text-transform: uppercase;
  padding: 32px;
  background-color: #0a0a23;
  color: #fff;
  border-bottom: 4px solid #fdb347;
}

.gallery {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 16px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 10px;
}

.gallery img {
  width: 100%;
  max-width: 350px;
  height: 300px;
  object-fit: cover;
  border-radius: 10px;
}

.gallery::after {
  content: "";
  width: 350px;
}
preview
▸ legacy rwd v8 Learn Typography by Building a Nutrition Label html + css
Concepts LearnedHTML: header · h1 · h2 · p · span · i · div · class · link to Google Fonts · CSS: font-family · font stack · font-size · rem · em · font-weight · letter-spacing · text-indent · text-align · negative margin · display: flex · justify-content: space-between · align-items · :not() · selector list · descendant selector · box-sizing · border · height
html
index.html
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>Nutrition Label</title>
  <link href="https://fonts.googleapis.com/css?family=Open+Sans:400,700,800" rel="stylesheet">
  <link href="./styles.css" rel="stylesheet">
</head>

<body>
  <div class="label">
    <header>
      <h1 class="bold">Nutrition Facts</h1>
      <div class="divider"></div>
      <p>8 servings per container</p>
      <p class="bold">Serving size <span>2/3 cup (55g)</span></p>
    </header>
    <div class="divider large"></div>
    <div class="calories-info">
      <div class="left-container">
        <h2 class="bold small-text">Amount per serving</h2>
        <p>Calories</p>
      </div>
      <span>230</span>
    </div>
    <div class="divider medium"></div>
    <div class="daily-value small-text">
      <p class="bold right no-divider">% Daily Value *</p>
      <div class="divider"></div>
      <p><span><span class="bold">Total Fat</span> 8g</span> <span class="bold">10%</span></p>
      <p class="indent no-divider">Saturated Fat 1g <span class="bold">5%</span></p>
      <div class="divider"></div>
      <p class="indent no-divider"><span><i>Trans</i> Fat 0g</span></p>
      <div class="divider"></div>
      <p><span><span class="bold">Cholesterol</span> 0mg</span> <span class="bold">0%</span></p>
      <p><span><span class="bold">Sodium</span> 160mg</span> <span class="bold">7%</span></p>
      <p><span><span class="bold">Total Carbohydrate</span> 37g</span> <span class="bold">13%</span></p>
      <p class="indent no-divider">Dietary Fiber 4g</p>
      <div class="divider"></div>
      <p class="indent no-divider">Total Sugars 12g</p>
      <div class="divider double-indent"></div>
      <p class="double-indent no-divider">Includes 10g Added Sugars <span class="bold">20%</span></p>
      <div class="divider"></div>
      <p class="no-divider"><span><span class="bold">Protein</span> 3g</span></p>
      <div class="divider large"></div>
      <p>Vitamin D 2mcg <span>10%</span></p>
      <p>Calcium 260mg <span>20%</span></p>
      <p>Iron 8mg <span>45%</span></p>
      <p class="no-divider">Potassium 235mg <span>6%</span></p>
    </div>
    <div class="divider medium"></div>
    <p class="note">* The % Daily Value (DV) tells you how much a nutrient in a serving of food contributes to a daily
      diet. 2,000 calories a day is used for general nutrition advice.</p>
  </div>
</body>
</html>
css
styles.css
* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  font-family: 'Open Sans', sans-serif;
}

.label {
  border: 2px solid black;
  width: 270px;
  margin: 20px auto;
  padding: 0 7px;
}

header h1 {
  text-align: center;
  margin: -4px 0;
  letter-spacing: 0.15px
}

p {
  margin: 0;
  display: flex;
  justify-content: space-between;
}

.divider {
  border-bottom: 1px solid #888989;
  margin: 2px 0;
}

.bold {
  font-weight: 800;
}

.large {
  height: 10px;
}

.large, .medium {
  background-color: black;
  border: 0;
}

.medium {
  height: 5px;
}

.small-text {
  font-size: 0.85rem;
}


.calories-info {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.calories-info h2 {
  margin: 0;
}

.left-container p {
  margin: -5px -2px;
  font-size: 2em;
  font-weight: 700;
}

.calories-info span {
  margin: -7px -2px;
  font-size: 2.4em;
  font-weight: 700;
}

.right {
  justify-content: flex-end;
}

.indent {
  margin-left: 1em;
}

.double-indent {
  margin-left: 2em;
}

.daily-value p:not(.no-divider) {
  border-bottom: 1px solid #888989;
}

.note {
  font-size: 0.6rem;
  margin: 5px 0;
  padding: 0;
  padding-left: 8px;
  padding-right: 8px;
  text-indent: -8px;
}
preview
▸ legacy rwd v8 Learn Accessibility by Building a Quiz html + css
Concepts LearnedHTML: header · nav · ul · a href="#id" · main · form · method · action · section · role="region" · aria-labelledby · label · for · input · text · email · date · fieldset · legend · radio · name · value · select · option · required · textarea · rows · cols · button · footer · address · br · sr-only · CSS: @media · prefers-reduced-motion · scroll-behavior · max() · min() · aspect-ratio · child combinator · :hover · color: inherit · padding-inline-start · margin-block · ::before · content · list-style · display: inline-block · clip · clip-path · selector list
html
index.html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="freeCodeCamp Accessibility Quiz practice project" />
    <title>Accessibility Quiz</title>
    <link rel="stylesheet" href="styles.css" />
  </head>
  <body>
    <header>
      <img id="logo" alt="freeCodeCamp" src="https://cdn.freecodecamp.org/platform/universal/fcc_primary.svg">
      <h1>HTML/CSS Quiz</h1>
      <nav>
        <ul>
          <li><a href="#student-info">INFO</a></li>
          <li><a href="#html-questions">HTML</a></li>
          <li><a href="#css-questions">CSS</a></li>
        </ul>
      </nav>
    </header>
    <main>
      <form method="post" action="https://freecodecamp.org/practice-project/accessibility-quiz">
        <section role="region" aria-labelledby="student-info">
          <h2 id="student-info">Student Info</h2>
          <div class="info">
            <label for="student-name">Name:</label>
            <input type="text" name="student-name" id="student-name" />
          </div>
          <div class="info">
            <label for="student-email">Email:</label>
            <input type="email" name="student-email" id="student-email" />
          </div>
          <div class="info">
            <label for="birth-date">Date of Birth:</label>
            <input type="date" name="birth-date" id="birth-date" />
          </div>
        </section>
        <section role="region" aria-labelledby="html-questions">
          <h2 id="html-questions">HTML</h2>
          <div class="question-block">
            <h3><span class="sr-only">Question</span>1</h3>
            <fieldset class="question" name="html-question-one">
              <legend>
                The legend element represents a caption for the content of its
                parent fieldset element
              </legend>
              <ul class="answers-list">
                <li>
                  <label for="q1-a1">
                    <input type="radio" id="q1-a1" name="q1" value="true" />
                    True
                  </label>
                </li>
                <li>
                  <label for="q1-a2">
                    <input type="radio" id="q1-a2" name="q1" value="false" />
                    False
                  </label>
                </li>
              </ul>
            </fieldset>
          </div>
          <div class="question-block">
            <h3><span class="sr-only">Question</span>2</h3>
            <fieldset class="question" name="html-question-two">
              <legend>
                A label element nesting an input element is required to have a
                for attribute with the same value as the input's id
              </legend>
              <ul class="answers-list">
                <li>
                  <label for="q2-a1">
                    <input type="radio" id="q2-a1" name="q2" value="true" />
                    True
                  </label>
                </li>
                <li>
                  <label for="q2-a2">
                    <input type="radio" id="q2-a2" name="q2" value="false" />
                    False
                  </label>
                </li>
              </ul>
            </fieldset>
          </div>
        </section>
        <section role="region" aria-labelledby="css-questions">
          <h2 id="css-questions">CSS</h2>
          <div class="formrow">
            <div class="question-block">
              <label for="selector">Can the CSS margin property accept negative values?</label>
            </div>
            <div class="answer">
              <select name="selector" id="selector" required>
                <option value="">Select an option</option>
                <option value="yes">Yes</option>
                <option value="no">No</option>
              </select>
            </div>
            <div class="question-block">
              <label for="css-textarea">Do you have any questions:</label>
            </div>
            <div class="answer">
              <textarea id="css-textarea" name="css-questions" rows="5" cols="24"></textarea>
            </div>
          </div>
        </section>
        <button type="submit">Send</button>
      </form>
    </main>
    <footer>
      <address>
        <a href="https://freecodecamp.org">freeCodeCamp</a><br />
        San Francisco<br />
        California<br />
        USA
      </address>
    </footer>
  </body>
</html>
css
styles.css
@media (prefers-reduced-motion: no-preference) {
  * {
    scroll-behavior: smooth;
  }
}

body {
  background: #f5f6f7;
  color: #1b1b32;
  font-family: Helvetica;
  margin: 0;
}

header {
  width: 100%;
  height: 50px;
  background-color: #1b1b32;
  display: flex;
  justify-content: space-between;
  align-items: center;
  top: 0;
}

#logo {
  width: max(10rem, 18vw);
  background-color: #0a0a23;
  aspect-ratio: 35 / 4;
  padding: 0.4rem;
}

h1 {
  color: #f1be32;
  font-size: min(5vw, 1.2em);
  text-align: center;
}

nav {
  width: 50%;
  max-width: 300px;
  height: 50px;
}

nav > ul {
  display: flex;
  justify-content: space-evenly;
  flex-wrap: wrap;
  align-items: center;
  padding-inline-start: 0;
  margin-block: 0;
  height: 100%;
}

nav > ul > li {
  color: #dfdfe2;
  margin: 0 0.2rem;
  padding: 0.2rem;
  display: block;
}

nav > ul > li:hover {
  background-color: #dfdfe2;
  color: #1b1b32;
  cursor: pointer;
}

li > a {
  color: inherit;
  text-decoration: none;
}

main {
  padding-top: 50px;
}

section {
  width: 80%;
  margin: 0 auto 10px auto;
  max-width: 600px;
}

h1,
h2 {
  font-family: Verdana, Tahoma;
}

h2 {
  border-bottom: 4px solid #dfdfe2;
  margin-top: 0px;
  padding-top: 60px;
}

.info {
  padding: 10px 0 0 5px;
}

.formrow {
  margin-top: 30px;
  padding: 0px 15px;
}

input {
  font-size: 1rem;
}

.info label, .info input {
  display: inline-block;
}

.info input {
  width: 50%;
  text-align: left;
}

.info label {
  width: 10%;
  min-width: 55px;
  text-align: right;
}

.question-block {
  text-align: left;
  display: block;
  width: 100%;
  margin-top: 20px;
  padding-top: 5px;
}

h3 {
  margin-top: 5px;
  padding-left: 15px;
  font-size: 1.375rem;
}

h3::before {
  content: "Question #";
}

.question {
  border: none;
  padding-bottom: 0;
}

.answers-list {
  list-style: none;
  padding: 0;
}

button {
  display: block;
  margin: 40px auto;
  width: 40%;
  padding: 15px;
  font-size: 1.438rem;
  background: #d0d0d5;
  border: 3px solid #3b3b4f;
}

footer {
  background-color: #2a2a40;
  display: flex;
  justify-content: center;
}

footer,
footer a {
  color: #dfdfe2;
}

address {
  text-align: center;
  padding: 0.3em;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
preview
▸ legacy cert project Tribute Page html
Concepts LearnedHTML: main · h1 · figure · figcaption · img · src · alt · section · p · a · href · target="_blank" · id · style element · CSS: id selector · display: block · max-width: 100% · height: auto · margin: 0 auto
html
index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
#image {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}
</style>
</head>
<body>
<main id="main">
  <h1 id="title">Chris</h1>
  <figure id="img-div">
    <img id="image" src="chris.jpg" alt="a photo of Chris">
    <figcaption id="img-caption">Chris — music in his ears, a cat in his lap.</figcaption>
  </figure>
  <section id="tribute-info">
    <p>Chris loved music the way few people do — not as background noise, but as a whole language.</p>
    <p>He loved cats just as fiercely — quiet, stubborn, loyal. it's why they still show up in everything I build.</p>
    <p>And he loved me. he believed in this before I did. every set and every line of code carries a little of him.</p>
  </section>
  <a id="tribute-link" href="https://twitch.tv/guerz" target="_blank">the music keeps going — {decompress}</a>
</main>
</body>
</html>
preview
▸ legacy rwd v8 Learn More About CSS Pseudo Selectors by Building A Balance Sheet html + css
Concepts LearnedHTML: table · caption · thead · tbody · tr · th · td · span · class · aria-hidden · sr-only · main · section · h1 · CSS: attribute selectors [attr] [attr="value"] [attr~="value"] · :first-of-type · :last-of-type · :nth-of-type() · :hover · !important · position: sticky · z-index · calc() · linear-gradient · border-collapse · border: double · flex-direction: column-reverse · negative margin · compound selector
html
index.html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Balance Sheet</title>
    <link rel="stylesheet" href="./styles.css">
  </head>
  <body>
    <main>
      <section>
        <h1>
          <span class="flex">
            <span>AcmeWidgetCorp</span>
            <span>Balance Sheet</span>
          </span>
        </h1>
        <div id="years" aria-hidden="true">
          <span class="year">2019</span>
          <span class="year">2020</span>
          <span class="year">2021</span>
        </div>
        <div class="table-wrap">
          <table>
            <caption>Assets</caption>
            <thead>
              <tr>
                <td></td>
                <th><span class="sr-only year">2019</span></th>
                <th><span class="sr-only year">2020</span></th>
                <th class="current"><span class="sr-only year">2021</span></th>
              </tr>
            </thead>
            <tbody>
              <tr class="data">
                <th>Cash <span class="description">This is the cash we currently have on hand.</span></th>
                <td>$25</td>
                <td>$30</td>
                <td class="current">$28</td>
              </tr>
              <tr class="data">
                <th>Checking <span class="description">Our primary transactional account.</span></th>
                <td>$54</td>
                <td>$56</td>
                <td class="current">$53</td>
              </tr>
              <tr class="data">
                <th>Savings <span class="description">Funds set aside for emergencies.</span></th>
                <td>$500</td>
                <td>$650</td>
                <td class="current">$728</td>
              </tr>
              <tr class="total">
                <th>Total <span class="sr-only">Assets</span></th>
                <td>$579</td>
                <td>$736</td>
                <td class="current">$809</td>
              </tr>
            </tbody>
          </table>
          <table>
            <caption>Liabilities</caption>
            <thead>
              <tr>
              <td></td>
              <th><span class="sr-only">2019</span></th>
              <th><span class="sr-only">2020</span></th>
              <th><span class="sr-only">2021</span></th>
              </tr>
            </thead>
            <tbody>
              <tr class="data">
                <th>Loans <span class="description">The outstanding balance on our startup loan.</span></th>
                <td>$500</td>
                <td>$250</td>
                <td class="current">$0</td>
              </tr>
              <tr class="data">
                <th>Expenses <span class="description">Annual anticipated expenses, such as payroll.</span></th>
                <td>$200</td>
                <td>$300</td>
                <td class="current">$400</td>
              </tr>
              <tr class="data">
                <th>Credit <span class="description">The outstanding balance on our credit card.</span></th>
                <td>$50</td>
                <td>$50</td>
                <td class="current">$75</td>
              </tr>
              <tr class="total">
                <th>Total <span class="sr-only">Liabilities</span></th>
                <td>$750</td>
                <td>$600</td>
                <td class="current">$475</td>
              </tr>
            </tbody>
          </table>
          <table>
            <caption>Net Worth</caption>
            <thead>
              <tr>
              <td></td>
              <th><span class="sr-only">2019</span></th>
              <th><span class="sr-only">2020</span></th>
              <th><span class="sr-only">2021</span></th>
              </tr>
            </thead>
            <tbody>
              <tr class="total">
                <th>Total <span class="sr-only">Net Worth</span></th>
                <td>$-171</td>
                <td>$136</td>
                <td class="current">$334</td>
              </tr>
            </tbody>
          </table>
        </div>
      </section>
    </main>
  </body>
</html>
css
styles.css
span[class~="sr-only"] {
  border: 0 !important;
  clip: rect(1px, 1px, 1px, 1px) !important;
  clip-path: inset(50%) !important;
  height: 1px !important;
  width: 1px !important;
  position: absolute !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  padding: 0 !important;
  margin: -1px !important;
}

html {
  box-sizing: border-box;
}

body {
  font-family: sans-serif;
  color: #0a0a23;
}

h1 {
  max-width: 37.25rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
}

h1 .flex {
  display: flex;
  flex-direction: column-reverse;
  gap: 1rem;
}

h1 .flex span:first-of-type {
  font-size: 0.7em;
}

h1 .flex span:last-of-type {
  font-size: 1.2em;
}

section {
  max-width: 40rem;
  margin: 0 auto;
  border: 2px solid #d0d0d5;
}

#years {
  display: flex;
  justify-content: flex-end;
  position: sticky;
  z-index: 999;
  top: 0;
  background: #0a0a23;
  color: #fff;
  padding: 0.5rem calc(1.25rem + 2px) 0.5rem 0;
  margin: 0 -2px;
}

#years span[class] {
  font-weight: bold;
  width: 4.5rem;
  text-align: right;
}

.table-wrap {
  padding: 0 0.75rem 1.5rem 0.75rem;
}

table {
  border-collapse: collapse;
  border: 0;
  width: 100%;
  position: relative;
  margin-top: 3rem;
}

table caption {
  color: #356eaf;
  font-size: 1.3em;
  font-weight: normal;
  position: absolute;
  top: -2.25rem;
  left: 0.5rem;
}

tbody td {
  width: 100vw;
  min-width: 4rem;
  max-width: 4rem;
}

tbody th {
  width: calc(100% - 12rem);
}

tr[class="total"] {
  border-bottom: 4px double #0a0a23;
  font-weight: bold;
}

tr[class="total"] th {
  text-align: left;
  padding: 0.5rem 0 0.25rem 0.5rem;
}

tr.total td {
  text-align: right;
  padding: 0 0.25rem;
}

tr.total td:nth-of-type(3) {
  padding-right: 0.5rem;
}

tr.total:hover {
  background-color: #99c9ff;
}

td.current {
  font-style: italic;
}

tr.data {
  background-image: linear-gradient(to bottom, #dfdfe2 1.845rem, white 1.845rem);
}

tr.data th {
  text-align: left;
  padding-top: 0.3rem;
  padding-left: 0.5rem;
}

tr.data th .description {
  display: block;
  font-weight: normal;
  font-style: italic;
  padding: 1rem 0 0.75rem;
  margin-right: -13.5rem;
}

tr.data td {
  vertical-align: top;
  padding: 0.3rem 0.25rem 0;
  text-align: right;
}

tr.data td:last-of-type{
  padding-right: 0.5rem;
}
preview
▸ legacy rwd v8 Learn Intermediate CSS by Building a Cat Painting html + css
Concepts LearnedCSS: position: absolute · top · left · right · bottom · margin: auto centering · z-index · transform: rotate() · border triangles (transparent borders) · border-radius (percent, per-corner, slash syntax) · linear-gradient · border-color shorthand · descendant selector · box-sizing · HTML: nested div · class
html
index.html
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>fCC Cat Painting</title>
    <link rel="stylesheet" href="./styles.css">
</head>
<body>
    <main>
      <div class="cat-head">
        <div class="cat-ears">
          <div class="cat-left-ear">
            <div class="cat-left-inner-ear"></div>
          </div>
          <div class="cat-right-ear">
            <div class="cat-right-inner-ear"></div>
          </div>
        </div>

        <div class="cat-eyes">
          <div class="cat-left-eye">
            <div class="cat-left-inner-eye"></div>
          </div>
          <div class="cat-right-eye">
            <div class="cat-right-inner-eye"></div>
          </div>
        </div>
        
        <div class="cat-nose"></div>

        <div class="cat-mouth">
          <div class="cat-mouth-line-left"></div>
          <div class="cat-mouth-line-right"></div>
        </div>

        <div class="cat-whiskers">
          <div class="cat-whiskers-left">
            <div class="cat-whisker-left-top"></div>
            <div class="cat-whisker-left-middle"></div>
            <div class="cat-whisker-left-bottom"></div>
          </div>
          <div class="cat-whiskers-right">
            <div class="cat-whisker-right-top"></div>
            <div class="cat-whisker-right-middle"></div>
            <div class="cat-whisker-right-bottom"></div>
          </div>
        </div>

      </div>
    </main>
</body>
</html>
css
styles.css
* {
  box-sizing: border-box;
}

body {
  background-color: #c9d2fc;
}

.cat-head {
  position: absolute;
  right: 0;
  left: 0;
  top: 0;
  bottom: 0;
  margin: auto;
  background: linear-gradient(#5e5e5e 85%, #45454f 100%);
  width: 205px;
  height: 180px;
  border: 1px solid #000;
  border-radius: 46%;
}

.cat-left-ear {
  position: absolute;
  top: -26px;
  left: -31px;
  z-index: 1;
  border-top-left-radius: 90px;
  border-top-right-radius: 10px;
  transform: rotate(-45deg);
  border-left: 35px solid transparent;
  border-right: 35px solid transparent;
  border-bottom: 70px solid #5e5e5e;
}

.cat-right-ear {
  position: absolute;
  top: -26px;
  left: 163px;
  z-index: 1;
  transform: rotate(45deg);
  border-top-left-radius: 90px;
  border-top-right-radius: 10px;
  border-left: 35px solid transparent;
  border-right: 35px solid transparent;
  border-bottom: 70px solid #5e5e5e;
}

.cat-left-inner-ear {
  position: absolute;
  top: 22px;
  left: -20px;
  border-top-left-radius: 90px;
  border-top-right-radius: 10px;
  border-bottom-right-radius: 40%;
  border-bottom-left-radius: 40%;
  border-left: 20px solid transparent;
  border-right: 20px solid transparent;
  border-bottom: 40px solid #3b3b4f;
}

.cat-right-inner-ear {
  position: absolute;
  top: 22px;
  left: -20px;
  border-top-left-radius: 90px;
  border-top-right-radius: 10px;
  border-bottom-right-radius: 40%;
  border-bottom-left-radius: 40%;
  border-left: 20px solid transparent;
  border-right: 20px solid transparent;
  border-bottom: 40px solid #3b3b4f;
}

.cat-left-eye {
  position: absolute;
  top: 54px;
  left: 39px;
  border-radius: 60%;
  transform: rotate(25deg);
  width: 30px;
  height: 40px;
  background-color: #000;
}

.cat-right-eye {
  position: absolute;
  top: 54px;
  left: 134px;
  border-radius: 60%;
  transform: rotate(-25deg);
  width: 30px;
  height: 40px;
  background-color: #000;
}

.cat-left-inner-eye {
  position: absolute;
  top: 8px;
  left: 2px;
  width: 10px;
  height: 20px;
  transform: rotate(10deg);
  background-color: #fff;
  border-radius: 60%;
}

.cat-right-inner-eye {
  position: absolute;
  top: 8px;
  left: 18px;
  transform: rotate(-5deg);
  width: 10px;
  height: 20px;
  background-color: #fff;
  border-radius: 60%;
}

.cat-nose {
  position: absolute;
  top: 108px;
  left: 85px;
  border-top-left-radius: 50%;
  border-bottom-right-radius: 50%;
  border-bottom-left-radius: 50%;
  transform: rotate(180deg);
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
  border-bottom: 20px solid #442c2c;
}

.cat-mouth div {
  width: 30px;
  height: 50px;
  border: 2px solid #000;
  border-radius: 190%/190px 150px 0 0;
  border-color: black transparent transparent transparent;
}

.cat-mouth-line-left {
  position: absolute;
  top: 88px;
  left: 74px;
  transform: rotate(170deg);
}

.cat-mouth-line-right {
  position: absolute;
  top: 88px;
  left: 91px;
  transform: rotate(165deg);
}

.cat-whiskers-left div {
  width: 40px;
  height: 1px;
  background-color: #000;
}

.cat-whiskers-right div {
  width: 40px;
  height: 1px;
  background-color: #000;
}

.cat-whisker-left-top {
  position: absolute;
  top: 120px;
  left: 52px;
  transform: rotate(10deg);
}

.cat-whisker-left-middle {
  position: absolute;
  top: 127px;
  left: 52px;
  transform: rotate(3deg);
}

.cat-whisker-left-bottom {
  position: absolute;
  top: 134px;
  left: 52px;
  transform: rotate(-3deg);
}

.cat-whisker-right-top {
  position: absolute;
  top: 120px;
  left: 109px;
  transform: rotate(-10deg);
}

.cat-whisker-right-middle {
  position: absolute;
  top: 127px;
  left: 109px;
  transform: rotate(-3deg);
}

.cat-whisker-right-bottom {
  position: absolute;
  top: 134px;
  left: 109px;
  transform: rotate(3deg);  
}
preview
▸ legacy rwd v8 Learn Responsive Web Design by Building a Piano html + css
Concepts LearnedHTML: div · img · alt · class · id · CSS: float · position: relative / absolute · ::after pseudo-element · compound selector (.key.black--key) · @media (max-width / min-width) · media query with two conditions · box-sizing: inherit · *::before, *::after · overflow: hidden · negative left offset
html
index.html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>Piano</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="stylesheet" href="./styles.css">
  </head>
  <body>
    <div id="piano">
      <img class="logo" src="https://cdn.freecodecamp.org/platform/universal/fcc_primary.svg" alt="freeCodeCamp Logo" />
      <div class="keys">
        <div class="key"></div>
        <div class="key black--key"></div>
        <div class="key black--key"></div>
        <div class="key"></div>
        <div class="key black--key"></div>
        <div class="key black--key"></div>
        <div class="key black--key"></div>

        <div class="key"></div>
        <div class="key black--key"></div>
        <div class="key black--key"></div>
        <div class="key"></div>
        <div class="key black--key"></div>
        <div class="key black--key"></div>
        <div class="key black--key"></div>

        <div class="key"></div>
        <div class="key black--key"></div>
        <div class="key black--key"></div>
        <div class="key"></div>
        <div class="key black--key"></div>
        <div class="key black--key"></div>
        <div class="key black--key"></div>
      </div>
    </div>
  </body>
</html>
css
styles.css
html {
  box-sizing: border-box;
}

*, *::before, *::after {
  box-sizing: inherit;
}

#piano {
  background-color: #00471b;
  width: 992px;
  height: 290px;
  margin: 80px auto;
  padding: 90px 20px 0 20px;
  position: relative;
  border-radius: 10px;
}

.keys {
  background-color: #040404;
  width: 949px;
  height: 180px;
  padding-left: 2px;
  overflow: hidden;
}

.key {
  background-color: #ffffff;
  position: relative;
  width: 41px;
  height: 175px;
  margin: 2px;
  float: left;
  border-radius: 0 0 3px 3px;
}

.key.black--key::after {
  background-color: #1d1e22;
  content: "";
  position: absolute;
  left: -18px;
  width: 32px;
  height: 100px;
  border-radius: 0 0 3px 3px;
}

.logo {
  width: 200px;
  position: absolute;
  top: 23px;
}

@media (max-width: 768px) {
  #piano {
    width: 358px;
  }

  .keys {
    width: 318px;
  }

  .logo {
    width: 150px;
  }
}

@media (max-width: 1199px) and (min-width: 769px) {
  #piano {
    width: 675px;
  }

  .keys {
    width: 633px;
  }
}@media (max-width: 1199px) and (min-width: 769px) {

}
preview
▸ legacy cert project Technical Documentation Page html + css
Concepts LearnedHTML: nav · header · a href="#id" (fragment links) · main · section · p · ul · li · code · id · class · CSS: position: fixed · overflow-y: auto · margin-left offset for a fixed sidebar · @media (max-width) · position: static · line-height · font stack · border-radius · descendant selector · display: block
html
index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="styles.css">
</head>
<body>
<nav id="navbar">
<header>CSS Documentation</header>
<a class="nav-link" href="#Introduction">Introduction</a>
<a class="nav-link" href="#Selectors">Selectors</a>
<a class="nav-link" href="#The_Box_Model">The Box Model</a>
<a class="nav-link" href="#Positioning">Positioning</a>
<a class="nav-link" href="#Responsive_Design">Responsive Design</a>
</nav>
<main id="main-doc">
<section class="main-section" id="Introduction">
<header>Introduction</header>
<p>CSS (Cascading Style Sheets) is the language used to style the visual presentation of web
pages.</p>
<p>It works alongside HTML, which provides structure, while CSS controls color, layout, and
typography.</p>
<ul>
<li>CSS separates content from presentation.</li>
<li>One stylesheet can style many pages.</li>
</ul>
</section>
<section class="main-section" id="Selectors">
<header>Selectors</header>
<p>A selector targets the HTML elements you want to style.</p>
<p>You can select by tag, class, id, or attribute.</p>
<code>p { color: navy; }</code>
<code>.button { padding: 8px; }</code>
<ul>
<li>Tag selectors target every element of a type.</li>
<li>Class selectors are reusable.</li>
</ul>
</section>
<section class="main-section" id="The_Box_Model">
<header>The Box Model</header>
<p>Every element is a rectangular box made of content, padding, border, and margin.</p>
<code>div { padding: 16px; border: 1px solid; }</code>
<p>Understanding the box model is key to controlling spacing.</p>
</section>
<section class="main-section" id="Positioning">
<header>Positioning</header>
<p>The position property controls how an element sits in the document flow.</p>
<code>.box { position: absolute; }</code>
<p>Values include static, relative, absolute, fixed, and sticky.</p>
</section>
<section class="main-section" id="Responsive_Design">
<header>Responsive Design</header>
<p>Responsive design lets one site adapt to any screen size.</p>
<code>@media (min-width: 768px) { }</code>
<p>Media queries apply styles based on the device.</p>
<ul>
<li>Use relative units for fluid layouts.</li>
</ul>
</section>
</main>
</body>
</html>
css
styles.css
* { box-sizing: border-box; }
body {
margin: 0;
font-family: -apple-system, Helvetica, Arial, sans-serif;
color: #2a2e3a;
line-height: 1.6;
}
/* fixed navbar on the left edge (test 21) */
#navbar {
position: fixed;
top: 0;
left: 0;
width: 280px;
height: 100%;
border-right: 2px solid #e2e5ec;
background: #f6f7fa;
padding: 20px;
overflow-y: auto;
}
#navbar header {
font-size: 1.4rem;
font-weight: 700;
margin-bottom: 16px;
}
.nav-link {
display: block;
padding: 8px 0;
color: #3a5a8a;
text-decoration: none;
border-top: 1px solid #e2e5ec;
}
/* main content sits to the right of the fixed navbar */
#main-doc {
margin-left: 300px;
padding: 24px 32px;
max-width: 800px;
}
.main-section header {
font-size: 1.6rem;
margin-top: 28px;
}
code {
display: block;
background: #f3f4f7;
padding: 8px 12px;
border-radius: 4px;
font-family: Menlo, Consolas, monospace;
margin: 8px 0;
}
/* media query (test 22): stack navbar on top for small screens */
@media (max-width: 768px) {
#navbar {
position: static;
width: 100%;
height: auto;
border-right: none;
border-bottom: 2px solid #e2e5ec;
}
#main-doc {
margin-left: 0;
}
}
preview
▸ legacy rwd v8 Learn CSS Variables by Building a City Skyline html + css
Concepts LearnedCSS: custom properties (variables) · :root · var() · linear-gradient · radial-gradient · repeating-linear-gradient · color stops · border triangles · vh / vw units · percent sizing · position: relative offsets · flexbox (column, wrap, space-evenly, flex-end) · selector list · @media redefining variables · overflow: hidden · HTML: nested div · class
html
index.html
<!DOCTYPE html>
<html lang="en">    
  <head>
    <meta charset="UTF-8">
    <title>City Skyline</title>
    <link href="styles.css" rel="stylesheet" />   
  </head>

  <body>
    <div class="background-buildings sky">
      <div></div>
      <div></div>
      <div class="bb1 building-wrap">
        <div class="bb1a bb1-window"></div>
        <div class="bb1b bb1-window"></div>
        <div class="bb1c bb1-window"></div>
        <div class="bb1d"></div>
      </div>
      <div class="bb2">
        <div class="bb2a"></div>
        <div class="bb2b"></div>
      </div>
      <div class="bb3"></div>
      <div></div>
      <div class="bb4 building-wrap">
        <div class="bb4a"></div>
        <div class="bb4b"></div>
        <div class="bb4c window-wrap">
          <div class="bb4-window"></div>
          <div class="bb4-window"></div>
          <div class="bb4-window"></div>
          <div class="bb4-window"></div>
        </div>
      </div>
      <div></div>
      <div></div>
    </div>

    <div class="foreground-buildings">
      <div></div>
      <div></div>
      <div class="fb1 building-wrap">
        <div class="fb1a"></div>
        <div class="fb1b"></div>
        <div class="fb1c"></div>
      </div>
      <div class="fb2">
        <div class="fb2a"></div>
        <div class="fb2b window-wrap">
          <div class="fb2-window"></div>
          <div class="fb2-window"></div>
          <div class="fb2-window"></div>
        </div>
      </div>
      <div></div>
      <div class="fb3 building-wrap">
        <div class="fb3a window-wrap">
          <div class="fb3-window"></div>
          <div class="fb3-window"></div>
          <div class="fb3-window"></div>
        </div>
        <div class="fb3b"></div>
        <div class="fb3a"></div>
        <div class="fb3b"></div>
      </div>
      <div class="fb4">
        <div class="fb4a"></div>
        <div class="fb4b">
          <div class="fb4-window"></div>
          <div class="fb4-window"></div>
          <div class="fb4-window"></div>
          <div class="fb4-window"></div>
          <div class="fb4-window"></div>
          <div class="fb4-window"></div>
        </div>
      </div>
      <div class="fb5"></div>
      <div class="fb6"></div>
      <div></div>
      <div></div>
    </div>
  </body>
</html>
css
styles.css
:root {
  --building-color1: #aa80ff;
  --building-color2: #66cc99;
  --building-color3: #cc6699;
  --building-color4: #538cc6;
  --window-color1: #bb99ff;
  --window-color2: #8cd9b3;
  --window-color3: #d98cb3;
  --window-color4: #8cb3d9;
}

* {
  box-sizing: border-box;
}

body {
  height: 100vh;
  margin: 0;
  overflow: hidden;
}

.background-buildings, .foreground-buildings {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: space-evenly;
  position: absolute;
  top: 0;
}

.building-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.window-wrap {
  display: flex;
  align-items: center;
  justify-content: space-evenly;
}

.sky {
  background: radial-gradient(
      closest-corner circle at 15% 15%,
      #ffcf33,
      #ffcf33 20%,
      #ffff66 21%,
      #bbeeff 100%
    );
}

/* BACKGROUND BUILDINGS - "bb" stands for "background building" */
.bb1 {
  width: 10%;
  height: 70%;
}

.bb1a {
  width: 70%;
}
  
.bb1b {
  width: 80%;
}
  
.bb1c {
  width: 90%;
}

.bb1d {
  width: 100%;
  height: 70%;
  background: linear-gradient(
      var(--building-color1) 50%,
      var(--window-color1)
    );
}

.bb1-window {
  height: 10%;
  background: linear-gradient(
      var(--building-color1),
      var(--window-color1)
    );
}

.bb2 {
  width: 10%;
  height: 50%;
}

.bb2a {
  border-bottom: 5vh solid var(--building-color2);
  border-left: 5vw solid transparent;
  border-right: 5vw solid transparent;
}

.bb2b {
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
      var(--building-color2),
      var(--building-color2) 6%,
      var(--window-color2) 6%,
      var(--window-color2) 9%
    );
}

.bb3 {
  width: 10%;
  height: 55%;
  background: repeating-linear-gradient(
      90deg,
      var(--building-color3),
      var(--building-color3),
      var(--window-color3) 15%
    );
}

.bb4 {
  width: 11%;
  height: 58%;
}

.bb4a {
  width: 3%;
  height: 10%;
  background-color: var(--building-color4);
}

.bb4b {
  width: 80%;
  height: 5%;
  background-color: var(--building-color4);
}
  
.bb4c {
  width: 100%;
  height: 85%;
  background-color: var(--building-color4);
}

.bb4-window {
  width: 18%;
  height: 90%;
  background-color: var(--window-color4);
}

/* FOREGROUND BUILDINGS - "fb" stands for "foreground building" */
.fb1 {
  width: 10%;
  height: 60%;
}

.fb1a {
  border-bottom: 7vh solid var(--building-color4);
  border-left: 2vw solid transparent;
  border-right: 2vw solid transparent;
}

.fb1b {
  width: 60%;
  height: 10%;
  background-color: var(--building-color4);
}
  
.fb1c {
  width: 100%;
  height: 80%;
  background: repeating-linear-gradient(
      90deg,
      var(--building-color4),
      var(--building-color4) 10%,
      transparent 10%,
      transparent 15%
    ),
    repeating-linear-gradient(
      var(--building-color4),
      var(--building-color4) 10%,
      var(--window-color4) 10%,
      var(--window-color4) 90%
    );
}

.fb2 {
  width: 10%;
  height: 40%;
}

.fb2a {
  width: 100%;
  border-bottom: 10vh solid var(--building-color3);
  border-left: 1vw solid transparent;
  border-right: 1vw solid transparent;
}

.fb2b {
  width: 100%;
  height: 75%;
  background-color: var(--building-color3);
}

.fb2-window {
  width: 22%;
  height: 100%;
  background-color: var(--window-color3);
}

.fb3 {
  width: 10%;
  height: 35%;
}
  
.fb3a {
  width: 80%;
  height: 15%;
  background-color: var(--building-color1);
}
  
.fb3b {
  width: 100%;
  height: 35%;
  background-color: var(--building-color1);
}

.fb3-window {
  width: 25%;
  height: 80%;
  background-color: var(--window-color1);
}

.fb4 {
  width: 8%;
  height: 45%;
  position: relative;
  left: 10%;
}

.fb4a {
  border-top: 5vh solid transparent;
  border-left: 8vw solid var(--building-color1);
}

.fb4b {
  width: 100%;
  height: 89%;
  background-color: var(--building-color1);
  display: flex;
  flex-wrap: wrap;
}

.fb4-window {
  width: 30%;
  height: 10%;
  border-radius: 50%;
  background-color: var(--window-color1);
  margin: 10%;
}

.fb5 {
  width: 10%;
  height: 33%;
  position: relative;
  right: 10%;
  background: repeating-linear-gradient(
      var(--building-color2),
      var(--building-color2) 5%,
      transparent 5%,
      transparent 10%
    ),
    repeating-linear-gradient(
      90deg,
      var(--building-color2),
      var(--building-color2) 12%,
      var(--window-color2) 12%,
      var(--window-color2) 44%
    );
}

.fb6 {
  width: 9%;
  height: 38%;
  background: repeating-linear-gradient(
      90deg,
      var(--building-color3),
      var(--building-color3) 10%,
      transparent 10%,
      transparent 30%
    ),
    repeating-linear-gradient(
      var(--building-color3),
      var(--building-color3) 10%,
      var(--window-color3) 10%,
      var(--window-color3) 30%
    );
}

@media (max-width: 1000px) {
  :root {
    --building-color1: #000;
    --building-color2: #000;
    --building-color3: #000;
    --building-color4: #000;
    --window-color1: #777;
    --window-color2: #777;
    --window-color3: #777;
    --window-color4: #777;
  }
  .sky {
    background: radial-gradient(
        closest-corner circle at 15% 15%,
        #ccc,
        #ccc 20%,
        #445 21%,
        #223 100%
      );
  }
}
    
preview
▸ legacy rwd v8 Learn CSS Grid by Building a Magazine html + css
Concepts Learneddisplay: grid · grid-template-columns · repeat() · minmax() · grid-column · grid-auto-flow · place-items · gap · object-fit · ::first-letter · rem units · @media
html
index.html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Magazine</title>
    <link
      href="https://fonts.googleapis.com/css?family=Anton%7CBaskervville%7CRaleway&display=swap"
      rel="stylesheet"
    />
    <link
      rel="stylesheet"
      href="https://use.fontawesome.com/releases/v5.8.2/css/all.css"
    />
    <link rel="stylesheet" href="styles.css" />
  </head>
  <body>
    <main>
      <section class="heading">
        <header class="hero">
          <img
            src="https://cdn.freecodecamp.org/platform/universal/fcc_meta_1920X1080-indigo.png"
            alt="freecodecamp logo"
            loading="lazy"
            class="hero-img"
          />
          <h1 class="hero-title">OUR NEW CURRICULUM</h1>
          <p class="hero-subtitle">
            Our efforts to restructure our curriculum with a more project-based
            focus
          </p>
        </header>
        <div class="author">
          <p class="author-name">
            By
            <a href="https://freecodecamp.org" target="_blank" rel="noreferrer"
              >freeCodeCamp</a
            >
          </p>
          <p class="publish-date">March 7, 2019</p>
        </div>
        <div class="social-icons">
          <a href="https://www.facebook.com/freecodecamp/">
            <i class="fab fa-facebook-f"></i>
          </a>
          <a href="https://twitter.com/freecodecamp/">
            <i class="fab fa-twitter"></i>
          </a>
          <a href="https://instagram.com/freecodecamp">
            <i class="fab fa-instagram"></i>
          </a>
          <a href="https://www.linkedin.com/school/free-code-camp/">
            <i class="fab fa-linkedin-in"></i>
          </a>
          <a href="https://www.youtube.com/freecodecamp">
            <i class="fab fa-youtube"></i>
          </a>
        </div>
      </section>
      <section class="text">
        <p class="first-paragraph">
          Soon the freeCodeCamp curriculum will be 100% project-driven learning. Instead of a series of coding challenges, you'll learn through building projects - step by step. Before we get into the details, let me emphasize: we are not changing the certifications. All 6 certifications will still have the same 5 required projects. We are only changing the optional coding challenges.
        </p>
        <p>
          After years - years - of pondering these two problems and how to solve them, I slipped, hit my head on the sink, and when I came to I had a revelation! A vision! A picture in my head! A picture of this! This is what makes time travel possible: the flux capacitor!
        </p>
        <p>
          It wasn't as dramatic as Doc's revelation in Back to the Future. It
          just occurred to me while I was going for a run. The revelation: the entire curriculum should be a series of projects. Instead of individual coding challenges, we'll just have projects, each with their own seamless series of tests. Each test gives you just enough information to figure out how to get it to pass. (And you can view hints if that isn't enough.)
        </p>
        <blockquote>
          <hr />
          <p class="quote">
            The entire curriculum should be a series of projects
          </p>
          <hr />
        </blockquote>
        <p>
          No more walls of explanatory text. No more walls of tests. Just one
          test at a time, as you build up a working project. Over the course of passing thousands of tests, you build up projects and your own understanding of coding fundamentals. There is no transition between lessons and projects, because the lessons themselves are baked into projects. And there's plenty of repetition to help you retain everything because - hey - building projects in real life has plenty of repetition.
        </p>
        <p>
          The main design challenge is taking what is currently paragraphs of explanation and instructions and packing them into a single test description text. Each project will involve dozens of tests like this. People will be coding the entire time, rather than switching back and forth from "reading mode" to "coding mode".
        </p>
        <p>
          Instead of a series of coding challenges, people will be in their code editor passing one test after another, quickly building up a project. People will get into a real flow state, similar to what they experience when they build the required projects at the end of each certification. They'll get that sense of forward progress right from the beginning. And freeCodeCamp will be a much smoother experience.
        </p>
      </section>
      <section class="text text-with-images">
        <article class="brief-history">
          <h3 class="list-title">A Brief History</h3>
          <p>Of the Curriculum</p>
          <ul class="lists">
            <li>
              <h4 class="list-subtitle">V1 - 2014</h4>
              <p>
                We launched freeCodeCamp with a simple list of 15 resources,
                including Harvard's CS50 and Stanford's Database Class.
              </p>
            </li>
            <li>
              <h4 class="list-subtitle">V2 - 2015</h4>
              <p>We added interactive algorithm challenges.</p>
            </li>
            <li>
              <h4 class="list-subtitle">V3 - 2015</h4>
              <p>
                We added our own HTML+CSS challenges (before we'd been relying on
                General Assembly's Dash course for these).
              </p>
            </li>
            <li>
              <h4 class="list-subtitle">V4 - 2016</h4>
              <p>
                We expanded the curriculum to 3 certifications, including Front-End,
                Back-End, and Data Visualization. They each had 10 required
                projects, but only the Front-End section had its own challenges.
                For the other certs, we were still using external resources like
                Node School.
              </p>
            </li>
            <li>
              <h4 class="list-subtitle">V5 - 2017</h4>
              <p>We added the back-end and data visualization challenges.</p>
            </li>
            <li>
              <h4 class="list-subtitle">V6 - 2018</h4>
              <p>
                We launched 6 new certifications to replace our old ones. This was
                the biggest curriculum improvement to date.
              </p>
            </li>
          </ul>
        </article>
        <aside class="image-wrapper">
          <img
            src="https://cdn.freecodecamp.org/testable-projects-fcc/images/random-quote-machine.png"
            alt="image of the quote machine project"
            loading="lazy"
            class="image-1"
            width="600"
            height="400"
          />
          <img
            src="https://cdn.freecodecamp.org/testable-projects-fcc/images/calc.png"
            alt="image of a calculator project"
            loading="lazy"
            class="image-2"
            width="400"
            height="400"
          />
          <blockquote class="image-quote">
            <hr />
            <p class="quote">
              The millions of people who are learning to code through freeCodeCamp
              will have an even better resource to help them learn these
              fundamentals.
            </p>
            <hr />
          </blockquote>
          <img
            src="https://cdn.freecodecamp.org/testable-projects-fcc/images/survey-form-background.jpeg"
            alt="four people working on code"
            loading="lazy"
            class="image-3"
            width="600"
            height="400"
          />
        </aside>
      </section>
    </main>
  </body>
</html>
css
styles.css
*,
::before,
::after {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

html {
  font-size: 62.5%;
}

body {
  font-family: 'Baskervville', serif;
  color: linen;
  background-color: rgb(20, 30, 40);
}

h1 {
  font-family: 'Anton', sans-serif;
}

h2, h3, h4, h5, h6 {
  font-family: 'Raleway', sans-serif;
}

a {
  text-decoration: none;
  color: linen;
}

main {
  display: grid;
  grid-template-columns: minmax(2rem, 1fr) minmax(min-content, 94rem) minmax(2rem, 1fr);
  row-gap: 3rem;
}

img {
  width: 100%;
  object-fit: cover;
}

hr {
  margin: 1.5rem 0;
  border: 1px solid rgba(120, 120, 120, 0.6);
}

.heading {
  grid-column: 2 / 3;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  row-gap: 1.5rem;
}

.text {
  grid-column: 2 / 3;
  font-size: 1.8rem;
  letter-spacing: 0.6px;
  column-width: 25rem;
  text-align: justify;
}

.hero {
  grid-column: 1 / -1;
  position: relative;
}

.hero-title {
  text-align: center;
  color: orangered;
  font-size: 8rem;
}

.hero-subtitle {
  font-size: 2.4rem;
  color: orangered;
  text-align: center;
}

.author {
  font-size: 2rem;
  font-family: "Raleway", sans-serif;
}

.author-name a:hover {
  background-color: #306203;
}

.publish-date {
  color: rgba(255, 255, 255, 0.5);
}

.social-icons {
  display: grid;
  font-size: 3rem;
  grid-template-columns: repeat(5, 1fr);
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  align-items: center;
}

.first-paragraph::first-letter {
  font-size: 6rem;
  color: orangered;
  float: left;
  margin-right: 1rem;
}

.quote {
  color: #00beef;
  font-size: 2.4rem;
  text-align: center;
  font-family: "Raleway", sans-serif;
}

.quote::before {
  content: '" ';
}

.quote::after {
  content: ' "';
}

.text-with-images {
  display: grid;
  grid-template-columns: 1fr 2fr;
  column-gap: 3rem;
  margin-bottom: 3rem;
}

.lists {
  list-style-type: none;
  margin-top: 2rem;
}

.lists li {
  margin-bottom: 1.5rem;
}

.list-title, .list-subtitle {
  color: #00beef;
}

.image-wrapper {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: repeat(3, min-content);
  gap: 2rem;
  place-items: center;
}

.image-1, .image-3 {
  grid-column: 1 / -1;
}

@media only screen and (max-width: 720px) {
  .image-wrapper {
    grid-template-columns: 1fr;
  }
}

@media only screen and (max-width: 600px) {
  .text-with-images {
    grid-template-columns: 1fr;
  }
}

@media only screen and (max-width: 550px) {
  .hero-title {
    font-size: 6rem;
  }
  
  .hero-subtitle,
  .author,
  .quote,
  .list-title {
    font-size: 1.8rem;
  }
  
  .social-icons {
    font-size: 2rem;
  }

  .text {
    font-size: 1.6rem;
  } 
}

@media only screen and (max-width: 420px) {
  .hero-title {
    font-size: 4.5rem;
  }
}
preview
▸ legacy cert project Product Landing Page html + css
Concepts LearnedHTML: header · nav · a href="#id" (fragment links) · main · section · h1 · h2 · h3 · iframe (YouTube embed) · form (action, method="post") · input type="email" · name · placeholder · required · input type="submit" · footer · id · class · CSS: position: fixed · body padding-top offset · flexbox (space-between, wrap, gap) · z-index · :hover · @media (max-width) · max-width + margin auto centering · border-radius · cursor: pointer
html
index.html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>bedmixing</title>
    <link rel="stylesheet" href="styles.css">
  </head>
<body>
  <header id="header">
    <img id="header-img" src="https://guerz.lol/favicon-peach.png" alt="Guerz Logo">
    <nav id="nav-bar">
      <a class="nav-link" href="#features">Features</a>
      <a class="nav-link" href="#video">Watch</a>
      <a class="nav-link" href="#form">Sign Up</a>
    </nav>
  </header>
  <main>
    <section id="hero">
      <h1>Guerz</h1>
      <p>))&lt;&gt;(( Back and Forth Forever and Ever</p>
    </section>
    <section id="features">
      <h2>Twitch VOD</h2>
      <div class="feature-list">
        <div class="feature">
          <h3>twitch.tv/guerz</h3>
          <p>Live Stream DJ Set</p>
        </div>
      </div>
    </section>
    <section id="video-section">
      <h2>Bedmixing</h2>
      <iframe id="video"
        src="https://www.youtube.com/embed/-4jzAhnYRsQ?si=DIi-gHQa_gaT3PM1"
        title="bedmixing"
        allouwfullscreen>
      </iframe>
    </section>
    <section id="signup">
      <h2>Get Guerz Updates</h2>
      <form id="form" action="https://www.freecodecamp.com/email-submit" method="post">
        <input id="email" type="email" name="email" placeholder="Enter your email addresss" required>
        <input id="submit" type="submit" value="Sign Up">
      </form>
    </section>
  </main>
  <footer id="footer">
    <p>Guerz - Bedmixing<p>
  </footer>
</body>
</html>
css
styles.css
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, Helvetica, Arial, sans-serif;
  color: #1c1c1c;
  padding-top: 64px;
}

#header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 64px;
  background-color: #1f2937;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 10;
}

#header-img { height: 36px; }

#nav-bar {
  display: flex;
  gap: 20px;
}

.nav-link {
  color: #e5e7eb;
  text-decoration: none;
  font-size: 15px;
}

.nav-link:hover { color: #3882f6; }

#hero {
  padding: 80px 24px;
  background-color: #f4f5f7;
  text-align: center;
}

#hero h1 {
  font-size: 2rem;
  max-width: 700px;
  margin: 0 auto 16px;
}

#hero p {
  font-size: 1.1rem;
  color: #4b5563;
  max-width: 600px;
  margin: 0 auto;
}

#features {
  padding: 60px 24px;
  text-align: center;
}

#features h2 { margin-bottom: 32px; }

.feature-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 32px;
}

.feature { max-width: 220px; }
.feature h3 { margin-bottom: 8px; }

#video-section {
  padding: 60px 24px;
  background-color: #1f2937;
  color: #e5e7eb;
  text-align: center;
}

#video {
  width: 100%;
  max-width: 640px;
  height: 360px;
  border: none;
  margin-top: 20px;
}

#signup {
  padding: 60px 24px;
  text-align: center;
}

#form {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
}

#email {
  padding: 10px 14px;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  min-width: 260px;
}

#submit {
  padding: 10px 20px;
  font-size: 1rem;
  background-color: #3882f6;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

#footer {
  padding: 24px;
  text-align: center;
  background-color: #1f2937;
  color: #e5e7eb;
}

@media (max-width: 600px) {
  #hero h1 { font-size: 1.5rem; }
  #nav-bar { gap: 12px; }
  .nav-link { font-size: 13px; }
  #video { height: 220px; }
}
preview
▸ legacy rwd v8 Learn CSS Animation by Building a Ferris Wheel html + css
Concepts LearnedHTML: div · span · class · CSS: @keyframes · animation-name · animation-duration · animation-iteration-count · animation-timing-function · animation shorthand · percentage keyframes (0% · 25% · 50% · 75% · 100%) · transform: rotate() · transform-origin · position: absolute · top / left / right in percent · :nth-of-type() · border-radius: 50% · vw units · max-width / max-height · two animations at once (wheel spins, cabins counter-spin)
html
index.html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <title>Ferris Wheel</title>
    <link rel="stylesheet" href="./styles.css">
  </head>
  <body>
    <div class="wheel">
      <span class="line"></span>
      <span class="line"></span>
      <span class="line"></span>
      <span class="line"></span>
      <span class="line"></span>
      <span class="line"></span>

      <div class="cabin"></div>
      <div class="cabin"></div>
      <div class="cabin"></div>
      <div class="cabin"></div>
      <div class="cabin"></div>
      <div class="cabin"></div>
    </div>
  </body>
</html>
css
styles.css
.wheel {
  border: 2px solid black;
  border-radius: 50%;
  margin-left: 50px;
  position: absolute;
  height: 55vw;
  width: 55vw;
  max-width: 500px;
  max-height: 500px;
  animation-name: wheel;
  animation-duration: 10s;
  animation-iteration-count: infinite;
  animation-timing-function: linear;
}

.line {
  background-color: black;
  width: 50%;
  height: 2px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform-origin: 0% 0%;
}

.line:nth-of-type(2) {
  transform: rotate(60deg);
}
.line:nth-of-type(3) {
  transform: rotate(120deg);
}
.line:nth-of-type(4) {
  transform: rotate(180deg);
}
.line:nth-of-type(5) {
  transform: rotate(240deg);
}
.line:nth-of-type(6) {
  transform: rotate(300deg);
}

.cabin {
  background-color: red;
  width: 20%;
  height: 20%;
  position: absolute;
  border: 2px solid;
  transform-origin: 50% 0%;
  animation: cabins 10s ease-in-out infinite;
}

.cabin:nth-of-type(1) {
  right: -8.5%;
  top: 50%;
}
.cabin:nth-of-type(2) {
  right: 17%;
  top: 93.5%;
}
.cabin:nth-of-type(3) {
  right: 67%;
  top: 93.5%;
}
.cabin:nth-of-type(4) {
  left: -8.5%;
  top: 50%;
}
.cabin:nth-of-type(5) {
  left: 17%;
  top: 7%;
}
.cabin:nth-of-type(6) {
  right: 17%;
  top: 7%;
}

@keyframes wheel {
   0% {
     transform: rotate(0deg);
   }
   100% {
     transform: rotate(360deg);
   }
}

@keyframes cabins {
  0% {
    transform: rotate(0deg);
  }
  25% {
    background-color: yellow;
  }
  50% {
    background-color: purple;
  }
 75% {
  background-color: yellow;
} 
  100% {
    transform: rotate(-360deg);
  }
}
preview
▸ legacy rwd v8 Learn CSS Transforms by Building a Penguin html + css
Concepts LearnedHTML: nested div · emoji character · multiple classes on one element · CSS: custom properties (:root · var()) · transform: rotate() · skew() · scale() · scaleX(-1) · transform-origin · transition · :active · ::before with content · @keyframes with only some percentages · animation shorthand · linear-gradient (angle + color stops) · border-radius with four values · position: relative + absolute · .penguin * (universal selector) · compound class selector (.face.left) · z-index · calc() · opacity · vh / vw
html
index.html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <link rel="stylesheet" href="./styles.css" />
    <title>Penguin</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  </head>

  <body>
    <div class="left-mountain"></div>
    <div class="back-mountain"></div>
    <div class="sun"></div>
    <div class="penguin">
      <div class="penguin-head">
        <div class="face left"></div>
        <div class="face right"></div>
        <div class="chin"></div>
        <div class="eye left">
          <div class="eye-lid"></div>
        </div>
        <div class="eye right">
          <div class="eye-lid"></div>
        </div>
        <div class="blush left"></div>
        <div class="blush right"></div>
        <div class="beak top"></div>
        <div class="beak bottom"></div>
      </div>
      <div class="shirt">
        <div>💜</div>
        <p>I CSS</p>
      </div> 
      <div class="penguin-body">
        <div class="arm left"></div>
        <div class="arm right"></div>
        <div class="foot left"></div>
        <div class="foot right"></div>
      </div>
    </div>

    <div class="ground"></div>
  </body>
</html>
css
styles.css
:root {
  --penguin-face: white;
  --penguin-picorna: orange;
  --penguin-skin: gray;
}

body {
  background: linear-gradient(45deg, rgb(118, 201, 255), rgb(247, 255, 222));
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.left-mountain {
  width: 300px;
  height: 300px;
  background: linear-gradient(rgb(203, 241, 228), rgb(80, 183, 255));
  position: absolute;
  transform: skew(0deg, 44deg);
  z-index: 2;
  margin-top: 100px;
}

.back-mountain {
  width: 300px;
  height: 300px;
  background: linear-gradient(rgb(203, 241, 228), rgb(47, 170, 255));
  position: absolute;
  z-index: 1;
  transform: rotate(45deg);
  left: 110px;
  top: 225px;
}

.sun {
  width: 200px;
  height: 200px;
  background-color: yellow;
  position: absolute;
  border-radius: 50%;
  top: -75px;
  right: -75px;
}

.penguin {
  width: 300px;
  height: 300px;
  margin: auto;
  margin-top: 75px;
  z-index: 4;
  position: relative;
  transition: transform 1s ease-in-out 0ms;
}

.penguin * {
  position: absolute;
}

.penguin:active {
  transform: scale(1.5);
  cursor: not-allowed;
}

.penguin-head {
  width: 50%;
  height: 45%;
  background: linear-gradient(
    45deg,
    var(--penguin-skin),
    rgb(239, 240, 228)
  );
  border-radius: 70% 70% 65% 65%;
  top: 10%;
  left: 25%;
  z-index: 1;
}

.face {
  width: 60%;
  height: 70%;
  background-color: var(--penguin-face);
  border-radius: 70% 70% 60% 60%;
  top: 15%;
}

.face.left {
  left: 5%;
}

.face.right {
  right: 5%;
}

.chin {
  width: 90%;
  height: 70%;
  background-color: var(--penguin-face);
  top: 25%;
  left: 5%;
  border-radius: 70% 70% 100% 100%;
}

.eye {
  width: 15%;
  height: 17%;
  background-color: black;
  top: 45%;
  border-radius: 50%;
}

.eye.left {
  left: 25%;
}

.eye.right {
  right: 25%;
}

.eye-lid {
  width: 150%;
  height: 100%;
  background-color: var(--penguin-face);
  top: 25%;
  left: -23%;
  border-radius: 50%;
}

.blush {
  width: 15%;
  height: 10%;
  background-color: pink;
  top: 65%;
  border-radius: 50%;
}

.blush.left {
  left: 15%;
}

.blush.right {
  right: 15%;
}

.beak {
  height: 10%;
  background-color: var(--penguin-picorna);
  border-radius: 50%;
}

.beak.top {
  width: 20%;
  top: 60%;
  left: 40%;
}

.beak.bottom {
  width: 16%;
  top: 65%;
  left: 42%;
}

.shirt {
  font: bold 25px Helvetica, sans-serif;
  top: 165px;
  left: 127.5px;
  z-index: 1;
  color: #6a6969;
}

.shirt div {
  font-weight:  initial;
  top: 22.5px;
  left: 12px;
}

.penguin-body {
  width: 53%;
  height: 45%;
  background: linear-gradient(
    45deg,
    rgb(134, 133, 133) 0%,
    rgb(234, 231, 231) 25%,
    white 67%
  );
  border-radius: 80% 80% 100% 100%;
  top: 40%;
  left: 23.5%;
}

.penguin-body::before {
  content: "";
  position: absolute;
  width: 50%;
  height: 45%;
  background-color: var(--penguin-skin);
  top: 10%;
  left: 25%;
  border-radius: 0% 0% 100% 100%;
  opacity: 70%;
}

.arm {
  width: 30%;
  height: 60%;
  background: linear-gradient(
    90deg,
    var(--penguin-skin),
    rgb(209, 210, 199)
  );
  border-radius: 30% 30% 30% 120%;
  z-index: -1;
}

.arm.left {
  top: 35%;
  left: 5%;
  transform-origin: top left; 
  transform: rotate(130deg) scaleX(-1);
  animation: 3s linear infinite wave;
}

.arm.right {
  top: 0%;
  right: -5%;
  transform: rotate(-45deg);
}

@keyframes wave {
  10% {
    transform: rotate(110deg) scaleX(-1);
  }
  20% {
    transform: rotate(130deg) scaleX(-1);
  }
  30% {
    transform: rotate(110deg) scaleX(-1);
  }
  40% {
    transform: rotate(130deg) scaleX(-1);
  }
}

.foot {
  width:  15%;
  height: 30%;
  background-color: var(--penguin-picorna);
  top: 85%;
  border-radius: 50%;
  z-index: -1;
}

.foot.left {
  left: 25%;
  transform: rotate(80deg);
}

.foot.right {
  right: 25%;
  transform: rotate(-80deg);
}

.ground {
  width: 100vw;
  height: 400px;
  background: linear-gradient(90deg, rgb(88, 175, 236), rgb(182, 255, 255));
  z-index: 3;
  position: absolute;
  margin-top: -58px;
  height: calc(100vh - 300px);
}
preview
▸ legacy cert project Personal Portfolio Webpage html + css
Concepts LearnedHTML: nav · ul · li · a href="#id" (fragment links) · target="_blank" · section · h1 · h2 · footer · id · class · CSS: position: fixed · flexbox (space-between, wrap, column, gap) · z-index · :hover · linear-gradient · list-style: none · 100vh section · overflow: hidden · display: inline-block · border-radius · @media (max-width)
html
index.html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Guerz — Portfolio</title>
  <link rel="stylesheet" href="styles.css">
</head>
<body>
  <nav id="navbar">
    <div class="nav-logo">guerz.lol</div>
    <ul class="nav-links">
      <li><a href="#welcome-section">Home</a></li>
      <li><a href="#projects">Projects</a></li>
      <li><a href="#contact">Contact</a></li>
    </ul>
  </nav>
  <section id="welcome-section">
    <h1>Oh, Hey, I am Guerz.</h1>
    <p>It's pronounced: "Guerz".</p>
  </section>
  <section id="projects">
    <h2>Stuff I've built</h2>
    <div class="projects-grid">
      <a href="https://guerz.lol" target="_blank" class="project-tile">
        <div class="project-thumb"></div>
        <p class="project-title">guerz.lol</p>
      </a>
      <a href="https://blog.guerz.lol" target="_blank" class="project-tile">
        <div class="project-thumb"></div>
        <p class="project-title">bloggerz</p>
      </a>
      <a href="https://builds.guerz.lol/" class="project-tile">
        <div class="project-thumb"></div>
        <p class="project-title">fCC Build Archive</p>
      </a>
    </div>
  </section>
  <section id="contact">
    <h2>Find me elsewhere</h2>
    <p>Come hang in the stream or poke around the code.</p>
    <a id="profile-link" href="https://github.com/gitguerz" target="_blank">GitHub</a>
  </section>
  <footer>
    <p>Built by Guerz — {decompress} · guerz.lol</p>
  </footer>
</body>
</html>
css
styles.css
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, Helvetica, Arial, sans-serif;
  color: #e5e7eb;
  background-color: #111827;
}

#navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background-color: #1f2937;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 10;
}

.nav-logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: #f9fafb;
}

.nav-links {
  display: flex;
  gap: 20px;
  list-style: none;
}

.nav-links a {
  color: #e5e7eb;
  text-decoration: none;
}

.nav-links a:hover { color: #a78bfa; }

#welcome-section {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0 24px;
  background: linear-gradient(135deg, #1f2937 0%, #4c1d95 100%);
}

#welcome-section h1 {
  font-size: 3rem;
  margin-bottom: 12px;
}

#welcome-section p {
  font-size: 1.2rem;
  color: #c4b5fd;
}

#projects {
  padding: 80px 24px;
  text-align: center;
}

#projects h2 {
  font-size: 2rem;
  margin-bottom: 40px;
}

.projects-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
}

.project-tile {
  width: 260px;
  background-color: #1f2937;
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: #e5e7eb;
}

.project-thumb {
  height: 150px;
  background: linear-gradient(135deg, #4c1d95 0%, #a78bfa 100%);
}

.project-title {
  padding: 14px;
  font-weight: 600;
}

#contact {
  padding: 80px 24px;
  text-align: center;
  background-color: #0f1420;
}

#contact h2 {
  font-size: 2rem;
  margin-bottom: 12px;
}

#profile-link {
  display: inline-block;
  margin-top: 20px;
  padding: 12px 28px;
  background-color: #7c3aed;
  color: white;
  text-decoration: none;
  border-radius: 6px;
}

footer {
  padding: 24px;
  text-align: center;
  background-color: #1f2937;
  color: #9ca3af;
}

@media (max-width: 600px) {
  #welcome-section h1 { font-size: 2rem; }
  .nav-links { gap: 12px; }
  .nav-logo { font-size: 0.95rem; }
}
preview
the archive lists every workshop, lab and certification project in the freeCodeCamp Responsive Web Design v9 curriculum (plus the legacy V8 courses), in order. built ones expand with their real, full source and a live preview — copy any block straight into an editor. the rest fill in as i work down the list.