Centre in Both Directions
HTML / CSS
20 pts
Centre in Both Directions
Use the two “both directions” techniques:
- Make
.heroa flex container and centre its heading withjustify-content: centerandalign-items: center. - Give
.photoposition: relative. - Centre the
.badgeon the photo:position: absolute,top: 50%,left: 50%andtransform: translate(-50%, -50%).
Checklist
- Centre the heading in the hero both ways with Flexbox.
- Make the photo the frame for the badge.
- Centre the badge exactly on the photo.
🔑 Solution
If you view the solution before passing, you earn half points for this exercise. You still need to type it and press Check to finish.
How it works, step by step
Point at a step to highlight its lines. Type the solution yourself and press Check answer to finish.
