3 card layout , responsive with 1 line.

Solution retrospective
I really feel like I nailed this one! this is actually my second attempt because the first submit was a disaster. I didn't expect it, but the whole thing feels perfectly responsive with a display flex @media 800px and that's it. One thing that I could refactor for sure is to condense some classes. Also is there a different way to do the hover effect on the buttons? I had to hack the button padding to adjust for border height so it wouldn't break my card height...
Please log in to post a comment
Log in with GitHubCommunity feedback
- @pikapikamart
Hey, great work on this one. Layout looks good in desktop, it is responsive and the mobile layout is good as well.
Regarding your query:
- Oh yes, a much simpler way. Instead of the
padding
and all of those. What you could just do is that. In the.btn
selector, you should just addborder: 2px solid transparent
. This way thebutton
already have theborder
. Then on the:hover
state, you could just do:
.btn:hover { border-color: apply the color needed }
You only need that :>>
Some suggestions as well would be:
- On the
main
tag, theoverflow: hidden;
is not really being used, you could remove that. - On the
body
tag, to center the content, you should addmin-height: 100vh
on thebody
. Do not mistook this withheight: 100vh
okay, the latter is not advisable to use, usemin-height: 100vh
. - Avoid multiple
h1
element on a webpage. Use only at least 1h1
. So change those car title intoh2
. Also just reminded, when using heading tags, do not skip a level. If you haveh3
makes sure thath1, h2
are present. - Since you are changing
h1
andh1
is needed in a webpage. On this one, theh1
would be ascreen-reader
only text. You could search forsr-only
. That is just a css styling intended for screen reader. But if you are starting out, I wouldn't mind about it, but it is good that you are informed about it. - Those
button
should have been usinga
tags. Since the container itself is not really aform
,button
elements on this is not good.
Aside from those, great work.
Marked as helpful - Oh yes, a much simpler way. Instead of the
Join 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