Design comparison
Solution retrospective
Which is the best way (without using display: flex) to center the container and its contents
Community feedback
- @FasunlePosted almost 2 years ago
Hi @Deem,
It is my pleasure to review your project. This is good for a starter and you can always become better. I will give a few tips that will help you do a better job.
-
Use can use either
grid
orflex
. However, using flex is more flexible for this simple case. Usingfloat
ortable
is not recommended as this is very painful to scale in real life. That is not to say that they do not have their uses as well. -
You can use picture tag to manage the two images without worrying about anything. Check this page to learn how to use it:
https://www.w3schools.com/htmL/html_images_picture.asp
-
Read about semantic html. This will enable you to know which tag to use under different contexts and also, how they should be arranged/organized. Check:
https://www.w3schools.com/htmL/html_images_picture.asp
-
On mobile screen size, ensure that your content does not take too much height. This prevents the image from getting too small (vertically). You can correct it by setting
max-height
for the content.
If you find this useful, kindly mark it as helpful.
Happy coding!!!
0 -
- @Victor-NyagudiPosted almost 2 years ago
Hi, Deeem.
You can also use
display: grid
, however, I'm curious why you don't want to use flexbox.Is it giving you issues?
Before grid and flexbox, front-end developers relied on
float
andclear
to position items inside a container. It wasn't always the best, but it got the job done.Read more about float and clear here.
Hope this helps.
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