RulerNature RulerNature - 1 year ago 121
Less Question

How to write border-radius in less without dividing result

How can I write this css into less:

border-radius: 10px / 20px;

normally css interpret something like :

border-bottom-left-radius: 10px 20px;
border-bottom-right-radius: 10px 20px;
border-top-left-radius: 10px 20px;
border-top-right-radius: 10px 20px;

but less compilers are dividing 10px/20px = 0.5px

Answer Source

This could be due to not having strict maths turned on in the compiler which tells it to only run maths within parenthesis.

An alternative is to trick the system into thinking its a normal string instead of a calculation.

border-radius: 10px ~"/" 20px;

Codepen Example

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download