0
$\begingroup$

I'm trying to calculate the width of an HTML element based on the window size.

Here's what I have. These width values (first value) accurately match with the width the HTML element must be (second value). However I need to get a formula for this to be able to set the width of the HTML correctly according to any possible window size.

window width / HTML element width

  • 1663 = 1916
  • 1221 = 1692
  • 1119 = 1641
  • 1038 = 1602
  • 630 = 1396

  • 1500 = ????

  • 1400 = ????
  • 2000 = ????

I've been staring at this four hours but I just can't wrap my head around it..

Any help would be appreciated.

Thanks in advance, Roel

  • 1
    All of your equations are false. $1663$ is _not_ the same as $1916$", and the $=$ sign does _not_ mean "corresponds to, in some unspecified context-dependent way".2012-04-26

1 Answers 1