Design comparison
Community feedback
- @Djamel1133Posted about 1 month ago
Hi,
For your first challenge, your code is "Oh my god!!!" I really like it. However, I have a few small remarks:
-
You have two breakpoints (
@media screen and (min-width: 768px)
), but in reality, they are the same. You can keep just one. If you want to follow the mobile-first approach, you can move all this:@media screen and (min-width: 768px) { .card-container { flex-direction: row; } .card-container .container.image-sec { width: 50%; height: auto; } .card-container .container.content-sec { width: 50%; } }
to your first code, each in its appropriate place (selector), and keep only the code for adjustments for desktop design:
@media screen and (max-width: 767px) { /* Your desktop-specific styles here */ }
-
You should use variables for colors, sizes, and more like this:
:root { --white: hsl(0, 0%, 100%); --small-size: 14px; /* More variables here */ }
Then use the variables instead of fixed values. It is cleaner, and you can change them in one place.
3-For units, use
em
orrem
instead of fixedpx
for responsiveness.I hope this is helpful. Enjoy coding, and see you at the next challenge!
Marked as helpful0 -
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