gpt4 book ai didi

css - 更少的 CSS - html 中的类声明?

转载 作者:太空宇宙 更新时间:2023-11-04 00:24:32 24 4
gpt4 key购买 nike

我得到了可以使用 less 的地方,但是这样做(不起作用):

<div class="fixed-width(150px)" ></div>

.fixed-width(@customWidth) {
width: @customWidth;
}

...似乎比提供的示例更有意义:

<div class="fixed-width" ></div>

.fixed-width {
.another-step(150px);
}

.another-step(@customWidth) {
width: @customWidth;
}

有没有一种简单的方法可以完成我所缺少的?

最佳答案

没有。 LESS 只编译 CSS 文件,不编译内联 CSS。您必须编写一个改进的解析器来生成您已经在使用的代码。

关于css - 更少的 CSS - html 中的类声明?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7423647/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com