© Mikael Olsson 2019
Mikael OlssonCSS3 Quick Syntax Referencehttps://doi.org/10.1007/978-1-4842-4903-1_27

27. Best Practices

Mikael Olsson1 
(1)
Hammarland, Finland
 

You now have an understanding of the fundamentals of CSS. This final chapter takes a step back to look at good coding practices and standards for style sheet development. Following these guidelines can help you write robust CSS code that is easy to maintain, reuse, and extend upon.

Reusable Code

A key idea to a manageable style sheet is to avoid duplicate code. Classes help achieve this goal because they are reusable and can be combined in different ways, giving you a flexible design that is easy to evolve.

Any time you find page items that share style properties, you should consider combining ...

Get CSS3 Quick Syntax Reference: A Pocket Guide to the Cascading Style Sheets Language now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.