docs.rodeo

MDN Web Docs mirror

Challenge: Fundamental CSS comprehension

{{LearnSidebar}} 

{{PreviousMenuNext("Learn_web_development/Core/Styling_basics/Debugging_CSS", "Learn_web_development/Core/Styling_basics/Fancy_letterheaded_paper", "Learn_web_development/Core/Styling_basics")}} 

This challenge provides a number of related exercises that must be completed in order to create the final design — a business card/gamer card/social media profile.

Starting point

To start this challenge, you should:

Alternatively, you could use an online editor such as CodePen, JSFiddle, or Glitch. You could paste the HTML and fill in the CSS into one of these online editors, and use this URL to point the <img> element to the image file.

[!NOTE] If you get stuck, you can reach out to us in one of our communication channels.

Project brief

You have been provided with some raw HTML and an image, and need to write the necessary CSS to style this into a nifty little online business card, which can perhaps double as a gamer card or social media profile. The following sections describe what you need to do.

Basic setup:

Taking care of the selectors and rulesets provided in the CSS resource file:

New rulesets you need to write:

[!NOTE] Bear in mind that the second ruleset sets font-size: 10px; on the <html> element — this means that for any descendants of <html>, an em will be equal to 10px rather than 16px as it is by default. (This is of course, provided the descendants in question don’t have any ancestors sitting in between them and <html> in the hierarchy that have a different font-size set on them. This could affect the values you need, although in this simple example this is not an issue.)

Other things to think about:

Hints and tips

Example

The following screenshot shows an example of what the finished design should look like:

A view of the finished business card, show a reader header and footer, and a darker center panel containing the main details and image.

{{PreviousMenuNext("Learn_web_development/Core/Styling_basics/Debugging_CSS", "Learn_web_development/Core/Styling_basics/Fancy_letterheaded_paper", "Learn_web_development/Core/Styling_basics")}} 

In this article

View on MDN