Results summary component (use only HTML & CSS)
Design comparison
Solution retrospective
Hi, eneryone! (。・∀・)ノ゙
Finally I finished this project and used relative units was some difficult. And I'd want to ask you: CSS code always takes many line? How can I write CSS code more shorter?
I'll glad to see any feedback or advice! Thanks for attention! ^____^
Community feedback
- @cisneConCorbataPosted over 1 year ago
Hi! CSS usually takes me a lot of lines as well, but there are ways to make it a little shorter. For starters, by checking your code, I can see you could save a lot of space by using this format to import fonts
@import url('https://fonts.googleapis.com/css2?family=Hanken+Grotesk:wght@500;700;800&display=swap');
and most properties have shorthands, ie, the shorthand for font is:
font: font-style font-variant font-weight font-size/line-height font-family;
just replace the values with what you need. That way, you don't use a line for each property, and most properties work this way, you can consult them at W3 schools
Marked as helpful1@kayyrbeksPosted over 1 year ago@cisneConCorbata I glad to hear what I'm not alone who write a lot of line css code. Thanks for useful advice and checking my code!
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