Jacob V. Jacob V. - 3 months ago 45
CSS Question

Converting pixels into percentages using CSS

I have a rectangle, the width is

and the height is
. I am trying to make the rectangle 5% bigger. How can I get increase the rectangle by 5%, while knowing the width and height in pixels.


CSS's calc function is your friend:

.rect {
    width: calc(125px * 105%);
    height: calc(48px * 105%);