gpt4 book ai didi

css - 链接 css 样式

转载 作者:太空宇宙 更新时间:2023-11-04 05:20:07 25 4
gpt4 key购买 nike

我怎样才能在 CSS 中做这样的事情:

#red-button {
.red
}

#green-button {
.green
}

.red {
background: red;
}

.green {
background: green;
}

我以前见过这种做法,但我似乎不记得是怎么做到的。

最佳答案

您可以使用 LESS (以及那里的其他类似解决方案)。

LESS extends CSS with dynamic behavior such as variables, mixins, operations and functions. LESS runs on both the client-side (IE 6+, Webkit, Firefox) and server-side, with Node.js.

还有SASS你可以使用。

Sass makes CSS fun again. Sass is an extension of CSS3, adding nested rules, variables, mixins, selector inheritance, and more. It’s translated to well-formatted, standard CSS using the command line tool or a web-framework plugin.

关于css - 链接 css 样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6806081/

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