Multiple Classes for Same Element (CSS Question)

Discussion in 'HTML' started by Matt Beckwith, Jul 12, 2003.

  1. I have attributes that I am applying to certain TD's in my document. That
    is, all the TD's on the right-hand side of the web page have certain
    attributes in common. The TD's on the left-hand side have different
    attributes. <TD class=right> <TD class=left>

    Now, I also am using a class to specify the colors of the borders of those
    TD's on the right-hand side. <TD class=yellow> The reason I'm doing this
    is so that I can change the borders of all the TD's on the web site by
    changing the style file, rather than changing the individual web pages.

    My quandary is: How do I do all of this, since a single TD can only have
    one class value? All of the TD's on the right need the class "right", but
    each needs a color class as well.

    Thanks.

    Matt Beckwith, M.D.
    http://www.doctorbeckwith.com
    Matt Beckwith, Jul 12, 2003
    #1
    1. Advertising

  2. Matt Beckwith

    Steve Pugh Guest

    "Matt Beckwith" <> wrote:

    >I have attributes that I am applying to certain TD's in my document. That
    >is, all the TD's on the right-hand side of the web page have certain
    >attributes in common. The TD's on the left-hand side have different
    >attributes. <TD class=right> <TD class=left>
    >
    >Now, I also am using a class to specify the colors of the borders of those
    >TD's on the right-hand side. <TD class=yellow>
    >
    >My quandary is: How do I do all of this, since a single TD can only have
    >one class value?


    Not true. class="yellow right" is perfectly fine. Supported by most
    CSS supporting browsers, (not Netscape 4, but hey that's no loss).

    Either apply multiple classes to the <td>s, or define extra classes
    that combine all the styles for .right and .yellow into a new class
    and use that for the relevant <td>s.

    Steve

    --
    "My theories appal you, my heresies outrage you,
    I never answer letters and you don't like my tie." - The Doctor

    Steve Pugh <> <http://steve.pugh.net/>
    Steve Pugh, Jul 12, 2003
    #2
    1. Advertising

  3. Matt Beckwith

    Sid Ismail Guest

    On Sat, 12 Jul 2003 14:22:39 -0400, "Matt Beckwith"
    <> wrote:

    : I have attributes that I am applying to certain TD's in my document. That
    : is, all the TD's on the right-hand side of the web page have certain
    : attributes in common. The TD's on the left-hand side have different
    : attributes. <TD class=right> <TD class=left>
    :
    : Now, I also am using a class to specify the colors of the borders of those
    : TD's on the right-hand side. <TD class=yellow> The reason I'm doing this
    : is so that I can change the borders of all the TD's on the web site by
    : changing the style file, rather than changing the individual web pages.
    :
    : My quandary is: How do I do all of this, since a single TD can only have
    : one class value? All of the TD's on the right need the class "right", but
    : each needs a color class as well.


    A good use for Dreamweaver, if you have it. It's a dream to do. Else,
    you'll need to code the "class=blahblah" in each right TD.
    An example: http://www.sabf.co.za/nationals/mixed.html

    Sid
    Sid Ismail, Jul 12, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. WindAndWaves

    css element within element....

    WindAndWaves, Feb 2, 2005, in forum: HTML
    Replies:
    29
    Views:
    901
    Leif K-Brooks
    Feb 3, 2005
  2. HANM
    Replies:
    2
    Views:
    700
    Joseph Kesselman
    Jan 29, 2008
  3. bluebaron
    Replies:
    3
    Views:
    727
    Jonathan N. Little
    Nov 4, 2009
  4. Cal Who
    Replies:
    5
    Views:
    950
    Cal Who
    Apr 26, 2010
  5. Qi
    Replies:
    7
    Views:
    800
Loading...

Share This Page