The Most Popular Plan

Most people choose Daily care, and the page should say so. We've added a label to its card: a span with the class badge, whose look is already in style.css. The card also has a new class, popular.

The label sits on the top edge of the card, partly above the card and partly in it, in the right half of the card. It takes up no space in the card, so the heading and the rest of the content are where they are in the other cards.

The whole card is also 8px higher than the others, so that it stands out. The other cards don't move.

The finished page looks like this (smaller):

Happy PawsHomePlansContact
Cat sitting while you're away
We look after your cat in its own home, where it feels best. Choose the plan that suits you.
Visit
€15 / day
One visit a day: fresh food and water and a clean litter box.
Choose
Most popular
Daily care
€25 / day
Two visits a day with time for play and cuddles, and a photo of your cat every evening.
Choose
Full care
€40 / day
Three visits a day, time for play, plants watered, mail collected and a video call whenever you miss your cat.
Choose
Call us at +420 123 456 789 or write to hello@happypaws.example.

A tip: in the lesson Display and Position, you put an element in the corner of another element. The same property can move the card itself, too.

That's the whole project. You've laid out a whole page: a navigation bar, cards that adapt to the width of the screen, buttons aligned at the bottom and a label exactly where it belongs. In the next lesson, CSS Grid, you'll learn to lay out elements in rows and columns at once.

Instructions

The label sits on the top edge of the middle card, in its right half, and the content of the card is where it is in the other cards.

The middle card is 8px higher than the other cards, which stay where they are.

Start programming for free

By signing up, you agree to the Terms of Service and Privacy Policy.

Or sign up with:

3/3