Less教程
Less函数

Less ispixel()

Less ispixel()

Less ispixel()函数将一个值作为参数,如果该值是一个像素,则返回TRUE,否则返回FALSE。

isurl()函数示例

让我们以一个示例演示Less文件中isurl()函数的用法。
创建一个Less名为"simple.less"的文件,具有以下代码:
less 的文件: simple.less
div {
    font:        ispixel(#ff0);          
    background:  ispixel(blue);    
    border:      ispixel("string");  
    font:        ispixel(1234);    
    background:  ispixel(56px);    
    border:      ispixel(7.8%);          
    border:      ispixel(keyword);               
}
现在打开node.js命令提示符并执行以下代码: lessc simple.less simple.css
缺少ispixel function1
这将编译"simple.less"文件。将会生成一个名为" simple.css"的CSS文件。
例如:
less ispixel function2
输出:
像素像素功能降低3
div {
  background: false;
  font: false;
  background: true;
  border: false;
}
昵称: 邮箱:
Copyright © 2022 立地货 All Rights Reserved.
备案号:京ICP备14037608号-4