Less convert()The Less convert function is used to convert number from one unit to another. It contains two arguments; first argument passes number along with unit and second argument contains units. The number is converted when the unit is compatible. If the first argument is unchanged then the unit is not compatible. Let's take an example to demonstrate the usage of convert function in Less. Create a Less file named "simple.less", having the following data. Less file: simple.less Now, execute the following code: lessc simple.less simple.css This will compile the "simple.less" file. A CSS file named "simple.css" will be generated. For example: Output:
Next TopicLess Data-uri Function
|