Design comparison
Solution retrospective
Hi guys. My second challenge on this platform. do you have any advice on how I could make my code more efficient?
Community feedback
- @nosthrillzPosted about 3 years ago
Technically, you can drop the img tag for each card and instead of loading it through html, you can load it in css and set it as a background to the image div.
That way, when you have a class of 'sedan', you will load the image for sedan. likewise for the others.
This would simplify the HTML a little bit :)
Also, when you want to add borders to buttons, to prevent the layout from shifting, make the default element with a transparent border. .btn { border: 1px solid transparent; } .btn:hover {border-color: red;}
Marked as helpful0@Robert-RynardPosted almost 3 years ago@latifii Another way of preventing this layout from shifting is using outline instead of border as they do not take up space and are drawn outside of the content
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