Counting/ Calculating Number of Pixels

What are different ways to figure out the values I need for layouts I want to create? 31% width and a 1.15% margin are values that seem to require some method of precise calculation to know. In addition, how do I account for all the devices that have different screen resolutions (pixel densities?)

Three columns, so

31 × 3 = 93

Margin is on the left and the right, so

1.15 × 6 = 6.9

93 + 6.9 = 99.9

So close as possible to 100%. Has nothing to do with pixels, it’s just adding up to 100. 100% of the width is 360px if the viewport width is 360px or 1,000,000px if the viewport width is 1,000,000px.

1 Like