Design comparison
Solution retrospective
This was my first responsive project that I finished with satisfaction , although it has still an issue
What challenges did you encounter, and how did you overcome them?Making it responsive and understanding how everything works was hard for me , but now i am able to do so with flexbox atleast .
What specific areas of your project would you like help with?The media queries for applying different border radius work absolutely fine in inspector mode , but when i resize whole browser window , then a point comes ( transition from 2 columns to final 1 column ) when the media queries mess up for 4-5 pixel width range . don't know what's the issue .
i am using edge browser if you are trying to help me thanks :)
Community feedback
- @krushnasinnarkarPosted 4 months ago
Hi @Vivek13130,
Congratulations on successfully completing the challenge! Your code is well-structured, and the website works beautifully across different screens (in inspector mode). You've done an excellent job ensuring responsiveness and functionality.
As you mentioned, when resizing the browser window to a small screen, the border radius doesn't work as expected. The issue you're facing might be due to the transition between media queries where the styles might not be applied consistently for a small range of pixel widths. This can happen if there are overlapping or conflicting styles in your media queries. Here's a refined approach to ensure smoother transitions between different breakpoints:
Key Changes and Explanations:
-
Consistent Flex Basis Calculation: Instead of hard-coding the width of
.card
in media queries, usecalc()
to account for padding and margins, ensuring consistent sizing and spacing. -
Flex Basis for Columns:
- For the range
632px to 932px
, useflex-basis: calc(50% - 2rem)
to create two columns. - For the range above
933px
, useflex-basis: calc(33.33% - 2rem)
to create three columns.
- For the range
-
Border Radius Adjustments: Kept the border radius adjustments consistent within media queries to ensure smooth transitions.
@media (min-width: 632px) and (max-width: 932px) { .card { flex-basis: calc(50% - 2rem); /* Adjust based on padding/margins */ } } @media (min-width: 933px) { .card { flex-basis: calc(33.33% - 2rem); /* Adjust based on padding/margins */ } }
By refining the media queries and using
calc()
, you can avoid the inconsistency and ensure the layout transitions smoothly across different breakpoints.Note: Adjust the values in
calc()
according to your actual padding and margin values to ensure proper spacing.I hope you find this helpful, and I would greatly appreciate it if you could mark my comment as helpful if it was.
Feel free to reach out if you have more questions or need further assistance.
Happy coding!
1 -
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