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
- Give the
bodyabackground-colorother than white, and afont-familythat ends insans-serif. - Make
.cardwhite, at most360pxwide and centered, with24pxof padding, aborder-radiusof16pxand centered text. - Make
.avatarround with aborder-radiusof50%. - Make
.tagsa flex container with centered items and agapof8px. - Give
.buttona 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
360pxwide and centered - The card has
24pxof padding,16pxrounded corners and centered text - The picture is round
- The tags are a centered flex row with an
8pxgap - The button has a background color that changes on hover
Lesson complete!
Get Your Certificate