Design comparison
Solution retrospective
I have solved this challenge with the most optimized code possible. If you think it can be improved, I will be happy to receive recommendations to improve it. Give me feedback if you like it, thanks you!
Community feedback
- @BenConfigPosted almost 3 years ago
Hey, well done on this challenge, it's a very nice solution.
For your card icons, you have declared
background-repeat: no-repeat;
andbackground-position: right;
on each one. Instead you could add those to your.card-icon
class and remove them from the individual classes which will save you 10 lines of code.Also you can remove
width: 100%;
from.card-icon
because it will take the full width of the parent by default, andtext-align: end;
doesn't appear to do anything so that can be removed too.0@Lourdes84Posted almost 3 years ago@BenConfig Hi Ben! First of all, thank you very much for your comments. I have tried to put the background properties to the card-icon class, but it has not worked for me so in the end I have put it in a single line to reduce the code:
Example: background: hsl(15, 100%, 70%) url(../images/icon-work.svg) no-repeat right;
I have also removed width: 100% and text-align: end from .card-icon. You´re right, It isn´t neccesary. Thank you very much for your advice, they have helped me!
0
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