Jump to content

multiple classes


earl_dc10
 Share

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
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
Share on other sites

This thread is more than a year old.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • 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.