使用Less动态增加z-index

时间:2014-12-04 19:08:07

标签: html css loops less z-index

我正在尝试增加类.box元素的z-index,因为它们在浏览器中动态显示而不使用任何JavaScript / jQuery。我尝试过使用原生css counter-increment,但这只对在屏幕上显示数字有用:

    .container {
        counter-reset: indexvalue;
    }

    .box {
        position: relative;
        counter-increment: indexvalue;
        z-index: counter(indexvalue);
    }

所以使用Less,请问如何增加屏幕上显示的每个.box的z-index?

非常感谢

1 个答案:

答案 0 :(得分:1)

不可能这样做。

Less编译器只在“编译时”创建一次CSS文件。

你试图完成的是“运行时间”。

相关问题