鍍金池/ 問答/HTML/ 這個(gè)`&`和`-btn-box`還有`-tra`代表的是什么意思?

這個(gè)`&`和`-btn-box`還有`-tra`代表的是什么意思?

在less語言中,這個(gè)&-btn-box還有-tra代表的是什么意思?

.own-space {

    &
    -btn-box {
      margin-bottom: 10px;

      button {
        padding-left: 0;

        span {
          color: #2D8CF0;
          transition: all .2s;
        }

        span:hover {
          color: #0C25F1;
          transition: all .2s;
        }
      }
    }

    &
    -tra {
      width: 10px;
      height: 10px;
      transform: rotate(45deg);
      position: absolute;
      top: 50%;
      margin-top: -6px;
      left: -3px;
      box-shadow: 0 0 2px 3px rgba(0, 0, 0, .1);
      background-color: white;
      z-index: 100;
    }
回答
編輯回答
離殤

不換行的我知道

pre{
    &-text{
        font-size: 12px;
    }
}

編譯成

pre-text{
    font-size: 12px;
}

&就是連接上一層選擇器字符的。
換行的話,你找個(gè)編譯工具看報(bào)錯(cuò)不。

2018年7月15日 22:36
編輯回答
墨小白
    -btn-box

編譯以后相當(dāng)于.own-space-btn-box

2018年6月18日 05:12