CommonLounge
Categories
About
Get Started
NaN.
Tips for writing better CSS code
[ Edit ]
From
Learn HTML & CSS
course
Choose your learning format:
Article
Cards
Video 🎁
Loading…
Category:
Web Development
1 Comment
Mark completed
Previous
Tips for writing better HTML code
Next
Quiz #5: Tables and Best Practices
About the contributors
AJ
Anant Jain
I work on CommonLounge's frontend.
PJ
Prabhav Jain
CS @ MIT. 11y experience. DM me for 1-on-1 mentorship (paid)
View Discussion (1)
Part of course:
Learn HTML & CSS
Tips for writing better HTML code
Previous item
Tips for writing better CSS code
Use comments to break up the document
Each style gets one line
Keep class name format consistent
Don’t nest lots of selectors
Create classes instead of styling HTML elements directly
Keep CSS to a minimum
Shorten HEX colors
Don’t add units when the value is 0
Separate base styles from their variations
Always keep learning
Quiz #5: Tables and Best Practices
Next item
Show admin stats