【发布时间】:2022-02-11 01:45:08
【问题描述】:
我想根据 html 提供的 typa 属性的条件应用样式,如下所示:
<img src="pf_brise_lame_bdef_034.jpg?itok=3vKP-E25" width="325" height="183" alt="Présentation de l'Association" title="Présentation de l'Association" loading="lazy" typeof="Image" class="lazy-hidden">
所以我不知道如何将条件写入我的scss文件,这是起点:
$attribut:[typeof="Image"];
@if $attribut == [typeof="Image"]{
background: transparent;
a{
display: none;
}
}
@else {
background: $gris-anthracite;
a{
display: initial;
}
}
实现此目的的正确语法是什么?变成一个 li 元素。
谢谢
【问题讨论】: