Writing CSS
-
Be consistent with indentation, spaces before/after colons and curly braces, quotations, and line spacing. If in doubt, follow the formatting of the code around you.
.hero { width: 100%; height: 450px; } .smalltalk { background-image: url("smalltalk.png"); }
Use meaningful id and class names.
Prefer classes over ids and use ids sparingly.
Avoid unnecessary nesting, ideally nest no more than 3 levels deep.
Avoid hacks: if you're using !important, you're likely doing something wrong.
Consider browser support.