0

When using calc, how can you add a unit?

I have tried the following:

font-size: calc(((768 / 100) * 6) / 16)rem;

font-size: calc(((768 / 100) * 6) / 16) rem;

font-size: calc(((768 / 100) * 6) / 16) + rem;

font-size: unit(calc(((768 / 100) * 6) / 16), rem);

I am using a LESS compiler, but can't find any indication on how in the LESS docs.

Edit - I have also tried removing 'calc':

font-size: ((768 / 100) * 6) / 16 rem

This outputs: font-size: 2.88 rem

How can you join 'rem' with the number?

Temani Afif
  • 245,468
  • 26
  • 309
  • 415
ccdavies
  • 1,576
  • 5
  • 19
  • 29

1 Answers1

0

you can in less use like this code

font-size: ((768 / 100) * 6) / 16rem;

in compile you can get this CSS

 font-size:2.88rem;
MBadrian
  • 409
  • 3
  • 10