Is there any way to assign multiple classes to a single HTML element? Here's the deal.
I have some table cells that I want to style. There are like 5 with different colored backgrounds, so that means 5 different styles. But I also want to add another style to some of these cells, which is adding an image to the corner of the cell. So I can make a separate style for that.
But is there a way to assign multiple styles to a single element? That would be ideal, because then I only have to define 6 styles. If there isn't, I have to define 10 different styles. It's not THAT big of a deal, but I was wondering if it could be done for future reference and for simplicity.
I've tried assigning both a class and an ID to a single element, which works. However, you can only use an ID for a specific HTML tag and you can't reuse it (or your page won't validate), so that's not really an option. Well, it works fine if you don't mind having invalid code on your webpage. But I mind, so I'd like a valid, standards-compliant technique.
I have some table cells that I want to style. There are like 5 with different colored backgrounds, so that means 5 different styles. But I also want to add another style to some of these cells, which is adding an image to the corner of the cell. So I can make a separate style for that.
But is there a way to assign multiple styles to a single element? That would be ideal, because then I only have to define 6 styles. If there isn't, I have to define 10 different styles. It's not THAT big of a deal, but I was wondering if it could be done for future reference and for simplicity.
I've tried assigning both a class and an ID to a single element, which works. However, you can only use an ID for a specific HTML tag and you can't reuse it (or your page won't validate), so that's not really an option. Well, it works fine if you don't mind having invalid code on your webpage. But I mind, so I'd like a valid, standards-compliant technique.