Is there a way to have an integer division (like 5 / 2 = 2) in CSS? I wanna know how many elements of a set number of pixels there are in my rom and use this number for margins but I can't find a way to do it.
Asked
Active
Viewed 1,069 times
2
-
https://developer.mozilla.org/en-US/docs/Web/CSS/calc – Temani Afif Apr 25 '20 at 20:34
-
Read that already I was wondering if there was a trick or something. – Gaetan L. Apr 25 '20 at 20:37
-
1share your real use case, there is a lof ot ways to achieve what you want but it's specific to each case – Temani Afif Apr 25 '20 at 20:41
-
Does this answer your question? [css calc - round down with two decimal cases](https://stackoverflow.com/questions/37754542/css-calc-round-down-with-two-decimal-cases) – Joshua Rose Apr 25 '20 at 20:45
-
I'd like a solution in vanilla CSS but it seems it's not possible. – Gaetan L. Apr 25 '20 at 20:48