English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Would this be legal syntax?

Director



I know about ID's and other selectors and all that. I just can't seem to find a definitive opinion on whether multiple classses are allowed, and if so, how the syntax would go.

Thanks

2006-06-30 03:12:33 · 3 answers · asked by molave 2 in Computers & Internet Programming & Design

3 answers

Each tag can only have one class attribute, but you can nest tags and classes. for example:



Lorem Ipsum



If the class bar defines the same stuff as foo (font color, etc.) it will overwrite whatever was defined in foo, but other than that they will work together.

2006-06-30 04:02:03 · answer #1 · answered by John J 6 · 0 1

Absolutely yes (I do it all the time).
The format I use is

stuff

(no comma required between the class names)

Works great. Conflicting directives in the second class will override those in the first one - this is consistent with CSS in a single class.

2006-06-30 11:15:27 · answer #2 · answered by sheeple_rancher 5 · 1 0

Try it out, but I think the second class tag pretty much cancels out the first....

Here are some other options...

Edit an existing tag for example p then do a p.customer
or
this...

2006-06-30 10:33:24 · answer #3 · answered by Duds331 5 · 0 0

fedest.com, questions and answers