gpt4 book ai didi

css less font-size 加减法

转载 作者:行者123 更新时间:2023-11-28 09:37:55 32 4
gpt4 key购买 nike

使用 LESS 有没有一种方法可以设置基本字体大小,然后稍后引用它并输出它说 1em 更小?例如:

@font-size: 3.025em;

然后在媒体查询或其他东西中:

@media only screen and (max-width: 959px) {
.box {
font-size: @font-size - 1em;
}
}

我尝试用谷歌搜索这个,但没有找到任何结果。

最佳答案

是的,你可以。您必须将基线字体大小设置为 LESS 将无法推断默认值是什么:

@font-size: 3.025em;

然后在媒体查询中:

@media only screen and (max-width: 959px) {
.box {
font-size: @font-size - 1em;
}
}

;)

关于css less font-size 加减法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18149609/

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