当前位置: 移动技术网 > IT编程>网页制作>CSS > sass(@at-root与&配合使用、without和with)

sass(@at-root与&配合使用、without和with)

2018年09月17日  | 移动技术网IT编程  | 我要评论

@at-root与&配合使用(找父级)

scss.style

css.style

应用于@keyframe

scss.style

css.style

 


@at-root (without: ...)和@at-root (with: ...)

默认@at-root只会跳出选择器嵌套,而不能跳出@media或@support。

如果要跳出这两种,则需使用@at-root (without: media),@at-root (without: support)

这个语法的关键词有四个:all(表示所有),rule(表示常规css),media(表示media),support(表示support,因为@support目前还无法广泛使用,所以在此不表)。

默认的@at-root其实就是@at-root (without:rule)。

scss.style

css.style


普通跳出嵌套

scss.style

css.style

 

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网