Design comparison
SolutionDesign
Solution retrospective
What are you most proud of, and what would you do differently next time?
-managed to complete the challenge calmly
What challenges did you encounter, and how did you overcome them?-Nothing
What specific areas of your project would you like help with?-to center images and text in the center of the div
Community feedback
- @kodan96Posted 6 months ago
hi there! ๐
You can center text and images within a
div
by applyingtext-align: center
to the div itself.If you have declared
width
on one of the text-based elements or image you need to applymargin-inline: auto;
ormargin: 0 auto;
on them. You can use other values than 0 withmargin
as well, depending on your layout decision.Hope this was helpful ๐
Good luck and happy coding! ๐ช
0
Please log in to post a comment
Log in with GitHubJoin our Discord community
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