Design comparison
Solution retrospective
Feedback welcome :)
Some questions:
-
Is it okay to hardcode min/max-width/height using px or should I use rem/em?
-
How is my HTML structure? Decided to go with an article divided into sections.
-
Is it better to make the column stay at its original size with margins or let it grow and shrink as I did? Best industry practices?
Community feedback
- @FluffyKasPosted over 2 years ago
Heyo,
That's a really nice looking solution! ^_^ To answer the quesitons:
-
I'd say probably using px for min/max-width/height isn't as bad as simply using fixed width/height. But I don't see a reason not to use rem for this purpose (other than the fact, that it may not be as comfortable using rem units, at first) to be 100% sure your solution is accessible and responsive.
-
I'd say article is fine. Nesting sections inside? Probably less so. Not that it's strictly bad, it's just gives you unnecessary errors in your accessibility report while not being any more semantic than a simple div.
-
I'd say it's always nice to have a max-width on items. You don't want components to stretch to eternity >.< I usually use a combination of width (in %) and max-width (in rem). Or max-width and some margin.
Some other things to note:
- It would be the best to just have one <h1> heading for your solution. All the rest can be <h2>, for example. You could have a screen-reader only <h1> saying "Cars for hire" or just uh, "Our cars" (I'm honestly struggling here to come up with a meaningful title >.<). Then you could apply a screen reader only class to this:
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
Or you could just leave the <h1> out completely, if you're not too bothered by the accessibility report.
-
I'd leave the alt texts for these icons empty. No reason for them to be there, they're decorative only.
-
It would be really nice if you added some transition animations to the buttons to make the hover look smoother.
I hope this helped a bit. Again, good job ^^
Marked as helpful2 -
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