View Single Post
Old 21-04-2008, 07:37   #7 (permalink)
paulmsmith
Paul Michael Smith
 
paulmsmith's Avatar
 
Join Date: Apr 2008
Location: Manchester, UK
Posts: 6
I think I know what you're asking turbo and in that case the answer is yes but not in the way you mean.

- Here are common attributes and their values for the three selectors.
#selector1, #selector2, .selector3 a {
attribute: val;
attribute: val;
attribute: val;
}

- Here you speficify the unique attributes/vals individually for the three selectors.
#selector1 { attribute: val; }
#selector2 { attribute: val; }
.selector3 a { attribute: val; }

Not the same as a function where you could pass in a different value for an attribute (as I understand what you want?) but you can override values from the common shared selectors within the unique selectors you have specified after.

Its the way the "Cascade" works in CSS. Its helps not think of CSS as a scripting language because its not that at all. It takes some time to understand the basics but once you have them down you can find nice ways to achieve what you want.
  Reply With Quote