Suppose I have a div
with a bunch of stuff inside:
-
Nesting CSS selectors is not possible with standard CSS, but there are other tools like SASS, LESS, and XCSS which allow you to write rules in the way you're describing.
These tools generally "compile" into real CSS which handles converting the nested selector syntax into real CSS rules.
讨论(0)
-
No, you can't nest rules in CSS yet. There are CSS preprocessors available which allow cool features like nesting, variables, etc.
Check out LESS.
讨论(0)
-
Yes, but not in regular CSS. You can use Sass! http://sass-lang.com/
讨论(0)