Nested CSS styles?

前端 未结 4 996
情歌与酒
情歌与酒 2021-01-28 14:07

Is something like this possible?

.imgbox:hover{ .ui-resizable-se { /*some style */ } }

Or a conceptual equivalent? Basically, only when an elem

4条回答
  •  再見小時候
    2021-01-28 14:50

    No, CSS does not allow nesting. You'd have to write it like this:

    .imgbox:hover .ui-resizable-se { /*some style */ }
    

    However, there are various CSS preprocessors available which convert something like this in valid CSS. The most popular ones are LESS and SASS/SCSS.

提交回复
热议问题