我试图在不使用任何 JavaScript/jQuery 的情况下增加类 .box
元素的 z-index,因为它们在浏览器中动态显示。我试过使用原生 css counter-increment
,但这只对在屏幕上显示数字有用:
.container {
counter-reset: indexvalue;
}
.box {
position: relative;
counter-increment: indexvalue;
z-index: counter(indexvalue);
}
那么使用 Less
,请问如何在每个 .box
出现在屏幕上时增加它们的 z-index?
非常感谢
最佳答案
这是不可能的。
Less 编译器只在“编译时”创建一次 CSS 文件。
您尝试完成的将是“运行时”。
关于html - 使用 Less 动态增加 z-index,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27302008/