Learn to code online with access to App Academy’s entire full-stack course for free
⏱ 2 hours
Modernize Craigslist
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.
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:
A more modern Craigslist homepage:
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.
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:
text-decoration
propertypadding
propertyUse a child combinator selector to:
list-style
propertyUse pseudo-classes on all A links and SPANs that are direct children of A links to:
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:
max-width
propertyUse ID selectors to style the elements with the IDs “leftbar”, “center”, and “rightbar” so that:
float
propertypadding
propertybox-sizing
propertyUse a tag selector on the FOOTER element to:
clear
propertyUse 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:
border-radius
propertyUse 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:
display
propertyul.clfooter
5px padding on the right sideThe 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:
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.
Right now, the calendar is looking a little peaked.
border-collapse
property to introduce the border back in. Set the border on each TD to be a solid 1px with color #333.cursor
property to indicate that a day without a link is not clickable. You’ll have to analyze the HTML to figure out how to do that. You cannot use CSS selectors to select an element and, then, apply a style to a parent element. So, you’ll need to figure out a way to select those table data elements.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
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.