Seven Common CSS Mistakes and How to Avoid Them
24
August
Seven common CSS Mistakes and How to Avoid Them. They are:
- Do not use HTML tags to achieve formatting or styling. HTML tags should be used for semantic markup, and CSS attributes should be used to format the content.
- Do not include CSS formatting directives inside HTML tags (or at least use them sparingly). Use CSS classes.
- Define common formatting characteristics only once.
- You can define more than one CSS class for each HTML element.
- Use hierarchical selectors instead of extra CSS classes.
- Store all CSS rules in external style sheets. Use the intra-document style sheets only to define exceptions that are local to a single document.
- If needed, break the CSS rules into multiple files and import the common files into section-specific files with the @import CSS rule.




