5 replies [Last post]
nix
nix's picture
Offline
Enthusiast
(n): a position or site occupied or available for occupancy or marked by some distinguishing feature
Last seen: 12 years 26 weeks ago
(n): a position or site occupied or available for occupancy or marked by some distinguishing feature
Timezone: GMT-4
Joined: 2003-08-12
Posts: 159
Points: 0

What I need to do is apply two classes to a table, but since I can't do that, I want to know if I can create two classes with the same name and then have the table call for them both?

.highlight { text-decoration:none; 
	color:"#000000";
}

.highlight td :hover{
background-color: #F0F0F0;
width: 100%;
} 
<table ... class="highlight">

The reason I want to do that is because the links in the table shouldn't have any decoration wether or not they are being hovered.

I refuse to be like the faceless masses of sheep and have a signatu......awwwwwwwww CRAP!!

Backups? Ha! I've never had troub**&{[}$$ERROR NO CARRIER

Root
Offline
Enthusiast
Brighton UK
Last seen: 14 years 42 weeks ago
Brighton UK
Joined: 2004-09-08
Posts: 76
Points: 0

two classes, one name?

Why not declare a class AND an id ? Eric Meyers very keen on it. It is a handy tip.

No class, little style and a lotta division.

Tony
Tony's picture
Offline
Moderator
Brisbane
Last seen: 5 weeks 5 days ago
Brisbane
Timezone: GMT+10
Joined: 2003-03-12
Posts: 5343
Points: 2964

two classes, one name?

Hi nix,
Multiple classes are supported by most modern browsers.
<table class="highlight another">

Hope that helps

seb
Offline
Enthusiast
Last seen: 14 years 44 weeks ago
Joined: 2003-09-20
Posts: 208
Points: 0

two classes, one name?

Tony (as always) is on the money here - one of my favourite CSS techniques, though I don't use it much. Amazingly works in IE!

Although from your vague description of the problem it doesn't sound like you need two classes to achieve what you want!

nix
nix's picture
Offline
Enthusiast
(n): a position or site occupied or available for occupancy or marked by some distinguishing feature
Last seen: 12 years 26 weeks ago
(n): a position or site occupied or available for occupancy or marked by some distinguishing feature
Timezone: GMT-4
Joined: 2003-08-12
Posts: 159
Points: 0

two classes, one name?

actually I do. the first class will always be used in the table nav bar. I don't want text decoration. the next one will only be called in that table if you mouseover(hover), I'll try calling for two classes, the way you showed.

edit* nope. didna narry work ya yungins. Oups

I know how to do what I want the long and tedious way, but I was hoping to do it with css. thanks though, I'll keep trying. It is better to fail trying than never try at all.

I refuse to be like the faceless masses of sheep and have a signatu......awwwwwwwww CRAP!!

Backups? Ha! I've never had troub**&{[}$$ERROR NO CARRIER

seb
Offline
Enthusiast
Last seen: 14 years 44 weeks ago
Joined: 2003-09-20
Posts: 208
Points: 0

two classes, one name?

the order in which the classes are given in the css page and the html code is important when using multiple classes - maybe that's your problem.

Multiple classes test case:
http://www.quirksmode.org/css/multipleclasses.html