3 ms·
100cm * 2840em = 18.94km? I don't get this. Could someone not missing something explain? Edit, to make the question clearer: The CSS of the 'spacer' div has
by zhte415 4y ago
100cm * 2840em = 18.94km?
I don't get this. Could someone not missing something explain?
Edit, to make the question clearer: The CSS of the 'spacer' div has:
Font size: 100cm;
Height: 2840em;
How does this result in 18.94km?
- bigDinosaur 4y agoI don't get it either. This is like one of those trick questions designed to prove that one can never actually be certain of something in CSS.
- kretaceous 4y agoI posted this on HN hoping to find an explanation. I tried all sorts of calculations, including measuring my screen size to find how many centimetres 1 pixel is but couldn't make sense of any it.
- trinovantes 4y agoHovering over the <html> tag shows the site's height is 10735200px 10735200 px / (37.8px / 1 cm) = 284000 cm Based on a 96dpi standard monitor (96px/in or 96px/2.56cm)
- roelschroeven 4y agoSmall nitpick: an inch is 2.54 cm, not 2.56 cm. That makes the html element 284035.5 cm high, which I guess is the height of that "whws" div plus the height of text and margins above and below. In any case about 28.4 m is a long way of from 18.94 km.
- trinovantes 4y agoOops you're right about that typo Although for css cm, browsers will use 37.8 px/cm instead of 96/2.54=37.7952 when making the conversion which gives the even 284000cm The only way I can think of to get 18.94 km from the browser's interpreted 2.84 km is if the website is physically projected/printed on a 14.4 dpi display like a billboard