Nesting selectors - possible?

后端 未结 3 1420
再見小時候
再見小時候 2021-01-19 03:43

Suppose I have a div with a bunch of stuff inside:

    相关标签:
    3条回答
    • 2021-01-19 04:28

      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 讨论(0)
    • 2021-01-19 04:32

      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 讨论(0)
    • 2021-01-19 04:48

      Yes, but not in regular CSS. You can use Sass! http://sass-lang.com/

      0 讨论(0)
    提交回复
    热议问题