gpt4 book ai didi

CSS 引用另一个 CSS

转载 作者:行者123 更新时间:2023-11-28 09:14:38 25 4
gpt4 key购买 nike

我正在使用样式表。t-button 用于定义为...的按钮

.t-button
{
border-color: #a7bac5;
color: #333;
}

此样式的定义在运行时生成在 .axd 文件中

有没有办法将这个特定的样式表应用到我的应用程序中的所有普通按钮?有点像……

button, input[type="button"], input[type="submit"]  
{
/*apply "t.button" */
}

最佳答案

CSS 无法做到这一点,但预编译的 CSS 扩展如 LESSSASS可以。

从 LESS 的首页窃取的示例:

.rounded-corners (@radius: 5px) {
border-radius: @radius;
-webkit-border-radius: @radius;
-moz-border-radius: @radius;
}

#header {
.rounded-corners;
}
#footer {
.rounded-corners(10px);
}

来自 SASS:

.error {
border: 1px #f00;
background: #fdd;
}

.badError {
@extend .error;
border-width: 3px;
}

关于CSS 引用另一个 CSS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6487253/

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