Forum Moderators: not2easy

Message Too Old, No Replies

Can this statement be written using shorthand?

Two id's, same pseudo class

         

Jeremy_H

3:42 pm on Jan 22, 2006 (gmt 0)

10+ Year Member



Hi,

Does anybody know if there is a way to write this css statement shorter?

#d a:hover,#h a:hover{color:#fcfcfc}

It seems like I should be able t group to pseudo classes together, but I'm at a loss.

Thanks

Robin_reala

10:15 pm on Jan 22, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Nope, that's as short as you're going to get, unless there's a common parent you can apply the styles to.

DrDoc

10:58 pm on Jan 22, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Unless, of course, there are no other links on the page ...
OR, if other links are set differently. For example, instead of:

#foo a:hover {}
#bar a:hover, #baz a:hover {}

You could simply do:

a:hover { /* #bar and #baz stuff goes here */ }
#foo a:hover {}

Jeremy_H

5:52 pm on Jan 25, 2006 (gmt 0)

10+ Year Member



Thanks, both of you, for your help.

It does look like it's going to get a short as it can go, since they aren't the only links on the page.

It just seems so lame, because when I look at it, it seems awfully redundant. But, when one thinks of how long others would right the same rules, I guess it is quiet a concise statement.

Anyways, what's a few bytes? (Alot! I'm one of those neurotic people that try to get my code as small as possible).

Thanks again