作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
使用 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/
使用 LESS 有没有一种方法可以设置基本字体大小,然后稍后引用它并输出它说 1em 更小?例如: @font-size: 3.025em; 然后在媒体查询或其他东西中: @media only sc
我是一名优秀的程序员,十分优秀!