Please note, this is a STATIC archive of website www.javatpoint.com from 19 Jul 2022, cach3.com does not collect or store any user information, there is no "phishing" involved.
Javatpoint Logo
Javatpoint Logo

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

Less-convert-function1"/

This will compile the "simple.less" file. A CSS file named "simple.css" will be generated.

For example:

Less-convert-function2"/

Output:

Less-convert-function3"/




Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA