Categories
Uncategorized

Why You Should Not Style Major Elements

I have done this to myself many times.  Have you ever thought, I want all my tables to look like XYZ.  So you throw table { border-color: blue; … } into CSS.

The problem is now you are stuck with that for all tables.  I think you should have a table style like table.blue_border { border-color: blue; …} that you can now apply to only the tables you want to with <table class=’blue_border’>.

You will inevitably need a standard table somewhere without the same style as the rest, but now you have to do more work to make that happen.  Do yourself a favor, use a reset for all HTML elements, and don’t style them directly.  Style a class that you will put on those elements.

 

Leave a Reply

Your email address will not be published. Required fields are marked *