You could use CSS flexbox. It works perfectly for positioning at the center both horizontally and vertically.
Marked as helpful
I'm unsure how best to get the sizing of the image and the component right.
I'm unsure how to deal with responsiveness at the lower end of mobile.
@brandonetter
Posted
Hey! Centering and sizing things can be hard. You can try using percentages and non-absolute values for sizing to help with responsiveness- and there's always @media queries in CSS!
https://codepen.io/brandonetter/pen/wvjZMeb
You can also add centering to your body to keep everything in the middle. Good work.
Marked as helpful
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord