markdown SASS'&'运营商

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown SASS'&'运营商相关的知识,希望对你有一定的参考价值。

## What is the `&` operator in SASS?
* Equivalent to **nesting**
* When you need more specific selector: for when you want to select an element that has 2
classes, but also be more specific at the same time:

```css
// plain css:
.some-class.another-class {}

// in SASS
.some-class {
  &.another.class {}
}

```

* Theyre both ways to select an element with one class **and** select a more specific element with
another class!
* You can also use `&` when nesting parent and child elements:

```css
// in SASS
.parent {
  .child {}
}

// can also be written as:
.parent {
  & .child {}
  // notice the space after the ampersand!!!
}
```

以上是关于markdown SASS'&'运营商的主要内容,如果未能解决你的问题,请参考以下文章

markdown [SASS功能] #sass #css

markdown [SASS cheatsheet] #css #sass

markdown Sass arquitecture

markdown SCSS / SASS资源

markdown SCSS / SASS基础知识

markdown 如何构建Sass项目