Design comparison
Solution retrospective
I noticed a small 'artifact' that present itself when clicking the buttons which adds a 1px border outline. It resizes the cards height ever so slightly. I think it's due to how flexbox calculates the spacing for each item. I couldn't find a way around it.
Updated solution: Refactored breakpoints and margins.
Community feedback
- @grace-snowPosted over 3 years ago
In html I recommend you
- change h1s for h2. Optional but in all liklihood this component would exist on a page with a heading so h2 would be better hierarchy
- remove alt values and leave the attributes empty instead, as these are meaningless images that can be ignored by screenreaders and bots. Then look up how to write alt text well for future challenges where you'll need to.
- change buttons for anchor tags. These would trigger navigation, not perform an action like toggling content.
Happy coding
Marked as helpful1 - @grace-snowPosted over 3 years ago
All you need is a border on the buttons to fix that layout shift. Make it the same color as the btn background or make it transparent. Either way, that tells the dom how high it needs to be, it's unrelated to flexbox
Marked as helpful1@LT-WebDevPosted over 3 years ago@grace-snow Thanks for this input - I too am busy with this challenge and had the same problem. Your input helped fix my problem ;).
Thanks again. LT
0 - @FarisPalayiPosted over 3 years ago
Nice job on this one👍
You can fix that by giving a fixed height to cards.
- Use
cursor: pointer
to buttons to better indicate interactivity. - Also, try to use a smaller media query breakpoint, because even though I'm using my laptop to see the solution, I'm getting the mobile version of the site.
Have fun coding 👍
Marked as helpful1@marcosfsousaPosted over 3 years ago@FarisPalayi Thanks for the input, Faris. I have
cursor: pointer
on the active states of the buttons, but I agree that before they are clicked they should hint to the user they are indeed interactable.I added some more breakpoints as you hinted.
Thank you for taking the time to reply to the project.
1 - Use
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