CSS selector organization

squeeks

New Member
I have some working CSS code, but I feel like there should be a more efficient way to organize my desired CSS. Basically, I want two separate CSS areas to behave the same in this instance, but different in others (which are not important to this question).Here is the working CSS: \[code\]#paragraph p a:visited, #paragraph2 p a:visited{color:#00f;} #paragraph p a:link, #paragraph2 p a:link{color:#f00;} \[/code\]I was envisioning something like this:\[code\](#paragraph | #paragraph2) p a{visited{color:#00f;}link{color:#f00;}}\[/code\]I will try to encapsulate my pseudocode in words, in case what I wrote doesn't make sense:Either #paragraph or #paragraph2, containing a "p" containing an "a". Then, change both the "link" and "visited" attributes w/in the "a" tag.First off, thanks to anybody who takes the time to read/answer. Secondly, there may be a better way to organize my document altogether, and it's totally cool if you have suggestions in that area, but I am also genuinely curious if the approach I came up w/ is possible, and how I would accomplish it this way.Thanks!
 
Back
Top