Jacob V. Jacob V. - 6 months ago 70
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%);