简体   繁体   English

如何在 Sass 中使用带有#id 的“目标”标签?

[英]how to use "target" tag with an #id in Sass?

I have a problem with my code in sass.我的 sass 代码有问题。

In css my code is :在 css 中我的代码是:

#slider-image-1:target ~ .s4-image-container;

but I don't know how I should write this is sass.但我不知道我应该怎么写这是sass。

Ther are some different syntaxes in sass to write pseudo-codes. sass 中有一些不同的语法来编写伪代码。 Hope this helps.希望这可以帮助。

 #slider-image-1{
  &:target{
    ~ .s4-image-container{
      /* CSS code */
    }
  }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM