Okay all of you CSS gurus, I could use some help coming up with a more advanced approach to my CSS classes.
Specifically, I would like to create a "polymorphic CSS class" that can easily be expanded and help reduce redundancy in my style-sheet!
In my website layout, I have a need for lots of "boxes".
For example, I might have an "Upcoming Events box", a "Special Offers box", a "Featured Article box", a "Top 10 List box", and so on.
Each of these example "boxes" would share common things, like:
- 1px gray border
- 20 px top/bottom margin
- 10 px padding
However, they could each be different with things like:
- reversed header?
Currently I just created a separate "box" for each need, for example:
The ultimate goal of me re-factoring my website is to write "smarter" HTML, CSS, and PHP, and cut out a lot of the duplicate, triplicate, quadruplic code that I have amassed over the past year while focusing more on cranking out pages and less on "re-usability"...
Wisdom is welcomed!!