Jump to content

multiple classes


earl_dc10

Recommended Posts

hey, Im wondering if I can have more than one class for an element, I have links on my page which I want to have all the same attributes, but each one have a unique setting so to speak. simplified example:

[code]
td.1
{
   background-color: black;
}
td.2
{
   border-style: solid;
}

// and then

<td class="1" class="2"></td>
[/code]
Link to comment
https://forums.phpfreaks.com/topic/5255-multiple-classes/
Share on other sites

I've never come across a situation where I've needed to do something like that, and as far as I know it's not possible.

I would do it like this...

[code]
table.parent {
}

table.parent td {
  /* set defaults */
}

table.parent td.1 {
  /* set specific 1 */
}

table.parent td.2 {
  /* set specific 2 */
}
[/code]
Link to comment
https://forums.phpfreaks.com/topic/5255-multiple-classes/#findComment-18663
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.