I've never seen such 'nesting' listed anywhere in any CSS how-to info, and I presume that (a) if it were possible, the technique would have been published, and (b) it hasn't been published because it doesn't work. Having said that, I haven't ever tested it, so I don't know for sure...

What you can do, though, is group selectors that have common declarations into one rule:

#nav p, #nav #tabs, #nav ul { property1: value-x ; property2: value-y ; property3: value-z ;}

and then add additional rules for declarations that are specific to individual IDs/classes (or which override the declarations in the grouped rule - the Cascade in CSS means that a later rule takes precedence over an earlier one):

#nav p { property4: value-a ; }
#nav #tabs { property2: value-b ; } /* overrides property2: value-y above */
#nav ul li a { property5: value-c ; }
...etc


HTH...

Nick
___________________________
Omnivision. Websight.
http://www.omnivision.com.au/

On Sunday, Oct 3, 2004, at 09:33 Australia/Sydney, Brian Duchek wrote:

Is there a syntax in CSS declarations which 'wraps' classes/ids in a
parent condition?  I'm not asking this very clearly, but the idea is
similar to the Javascript syntax...

with  {
...
}

The purpose being, I find myself writing a lot of statements like the below

#navigation p {...}
#navigation #tabs {...}
#navigation #tabs ul li a {...}

Isn't there an easier/more efficient way to apply the parent selector
#navigation to all the different groups?

#navigation {
 p {...}
 #tabs{...}
}

Does anyone know if the above works, or if it has any browser support holes?

I only ask because I know the people on this list can chew up this
question and spit it out like no one else :-)

Thanks,
--
Brian Duchek
=-=-=-=-=-=-=-=
e: [EMAIL PROTECTED]
w: new.inquiline.com
=-=-=-=-=-=-=-=
******************************************************
The discussion list for  http://webstandardsgroup.org/

 See http://webstandardsgroup.org/mail/guidelines.cfm
 for some hints on posting to the list & getting help
******************************************************




****************************************************** The discussion list for http://webstandardsgroup.org/

See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
******************************************************



Reply via email to