Multiple Classes for Same Element (CSS Question)

M

Matt Beckwith

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
 
S

Steve Pugh

Matt Beckwith said:
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
 
S

Sid Ismail

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

: 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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,017
Latest member
GreenAcreCBDGummiesReview

Latest Threads

Top