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:
- background-colors
- font-color
- reversed header?
- etc.
Currently I just created a *separate* "box" for each need, for example:
#box_Events{}
#box_Featured()
#box_Top10{}
#box_Specials{}
#box_Articles{}
#box_OnSale{}
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!!
Debbie



Reply With Quote





Or am I thinking of something like "class1+class2" ??)


Bookmarks