Forum Moderators: not2easy

Message Too Old, No Replies

Distilling CSS

Trying not to be so repetitious

         

photon

7:55 pm on Sep 25, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have a CSS ruleset as follows:

#showM img, #showW img, #showF img {float:right;}
#showT img, #showU img {float:left;}

Is there a way to group the IDs to avoid repeating

img
after every single one? Something like

(#showM, #showW, #showF) img {float:right;}
(#showT, #showU) img {float:left;}

Ryan8720

10:08 pm on Sep 25, 2003 (gmt 0)

10+ Year Member



I don't think so. I fairly sure that parenthesis are not allowed, except for things like url();.

drbrain

10:57 pm on Sep 25, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Why not instead use a class?

.left-img img { float: left }

photon

1:17 pm on Sep 26, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Would you believe that I have two classes used elsewhere already defined to do exactly that? For some reason, I just never thought of combining them.

Thanks drbrain. And thanks Ryan8720 for confirming what I thought about the grouping.