CSS Basics · Lesson 11 of 11

Project: A Profile Card

For the last lesson you style a profile card from start to finish. The HTML is ready. The CSS file is empty.

This is what the finished card should have:

  • a soft background color behind the whole page
  • a white card, centered on the page, no wider than 360 pixels
  • rounded corners and room around its content
  • centered text in a sans-serif font
  • a round picture
  • a row of tags built with flexbox
  • a button that changes color when the mouse is over it

Everything on that list comes from an earlier lesson. Work through the task steps one at a time and keep an eye on the preview.

One new trick: round pictures

A border-radius of 50% turns a square box into a circle:

.avatar {
  border-radius: 50%;
}

There is more than one right answer. The checks measure the result, so choose your own colors where the task does not name one.

Your Task

  1. Give the body a background-color other than white, and a font-family that ends in sans-serif.
  2. Make .card white, at most 360px wide and centered, with 24px of padding, a border-radius of 16px and centered text.
  3. Make .avatar round with a border-radius of 50%.
  4. Make .tags a flex container with centered items and a gap of 8px.
  5. Give .button a background color, and a different background color on :hover.
  • The page has a background color that is not white, and a sans-serif font
  • The card is white, at most 360px wide and centered
  • The card has 24px of padding, 16px rounded corners and centered text
  • The picture is round
  • The tags are a centered flex row with an 8px gap
  • The button has a background color that changes on hover