App Academy Open

Learn to code online with access to App Academy’s entire full-stack course for free

Craigslist is a notoriously under-designed and also very successful website. Its table-like design, gray panels, and royal blue hyperlinks hearken back to the early days of the Internet. It might be a blast from the past, but with a few simple style tweaks we can bring Craigslist into the modern world.

In this project, you will use CSS attributes to update the styles on an example Craigslist homepage. Use what you’ve learned about HTML attributes and CSS selectors to apply styles to various DOM elements.

Note: In some of the instructions, you will be given the name of a CSS property that you are to use. You can use the MDN CSS Reference to help you figure out how to use those properties. Once a property has been introduced to you, following instructions that use it will not refer to the property, again.

To start, clone the repository at https://github.com/appacademy-starters/css-modernize-craigslist-starter.

Project overview

The objective of this project is to re-skin the Craigslist homepage to use a more modern design aesthetic. Visit craigslist.org to see the most current version of the site. The following two screenshots show Craigslist’s current homepage and an updated homepage, respectively.

Current Craigslist homepage:

Craigslist screen shot
Craigslist screen shot

A more modern Craigslist homepage:

Updated Craigslist page
Updated Craigslist page

We have set up a project folder called attributes-project for you to use. The attributes-project.html file contains all the HTML for the example Craigslist homepage. Write all of your CSS for the page in attributes-project.css, which is linked in the HTML file.

Phase 1: Add initial page styles

Your Craigslist page should be bare-bones HTML at this point. Add the following initial styles to the page in your attributes-project.css file to make it look better:

Use the universal selector to make all elements:

Use tag selectors to:

Use a child combinator selector to:

Use pseudo-classes on all A links and SPANs that are direct children of A links to:

Phase 3: Style the main page sections

There are three main sections in the body of the page, represented by the HTML elements with these IDs: “leftbar”, “center” and “rightbar”. Style their container, represented by the element with the class name of “page-container”, as well as the three main sections, according to the specs below.

Use a class selector to select the element with the class “page-container” and:

Use ID selectors to style the elements with the IDs “leftbar”, “center”, and “rightbar” so that:

Use a tag selector on the FOOTER element to:

Use ID selectors to select the elements with the IDs “leftbar” and “rightbar” and:

Use an ID selector to select the element with the ID “center” and:

Use a child combinator selector to style all DIVs that are direct children of the element with the “center” ID:

Use a descendant combinator selector to style the H2 that is a descendant of the element with the “topban” ID:

Use a tag+class selector to style the UL element with the class name “clfooter” and:

Use a child combinator selector to style all LI elements that are direct children of the UL with the class name “clfooter” and:

Phase 5: Add pseudo-elements

The Craigslist logo is a purple peace sign, which also happens to be a common emoji these days. What else screams 2010s and beyond better than emojis? So, let’s add some to the Craigslist homepage!

Peace Symbol Emoji:

Peace emoji
Peace emoji

Create pseudo-elements to add the purple peace sign emoji before every H4 element with the class name “ban” using the ::before pseudo-element.

Hint: While pseudo-classes let you style elements based on their state, pseudo-elements let you style specific parts of the selected element. The ::before pseudo-element will create a pseudo-element that is the first child of the selected element. This pseudo-element will not introduce a new element into the DOM (hence, pseudo).

macOS Pro-Tip: You can use Control+Command+Spacebar on a Mac to pull up the emoji keyboard. Search for the purple peace sign emoji.

Bonus: style the calendar

Right now, the calendar is looking a little peaked.

Bonus: use more pseudo-classes

In this project, you used pseudo-classes to style elements based on their hover and visited states. Can you use more pseudo-classes? Use three more pseudo-classes to style elements on the page.

Check out the MDN doc on pseudo-classes for a full list. Some good ones to use: :focus, :first-child, :last-child, :nth-child

When you’re done

Call in an instructor to have them look at it. Well done!

Did you find this lesson helpful?

Archive your file into a .zip folder and click Submit Project to upload.

Solutions become available after uploading.

Source