I also found this problem.
After playing with MANY lost pieces of paper, I discovered that Chrome is trying to scale HTML.
For example, add the full width divider to your sample below and it will resize the window correctly because you are asking Chrome to make the field 100% of the page and thus forcing a 1: 1 scale page.
<!doctype html> <html> <head> <style type="text/css"> div.box { border: 1px solid black; width: 5cm; } div.forcer { width: 100%; height: 1px; border: 1px dotted green; } </style> </head> <body> <div class="box">box</div> <div class="forcer"></div> </body> </html>
Unfortunately, when I tried this, it did not fix the height problem, but also I could not make the 0px field without losing the correct scaling.
By the way, look at how this affects print sizes. A.
<!doctype html> <html> <head> <style type="text/css"> div.box { border: 1px solid black; width: 5cm; } div.forcer { width: 200%; height: 1px; border: 1px dotted green; } </style> </head> <body> <div class="box">box</div> <div class="forcer"></div> </body> </html>
In a nutshell: the print capabilities in Chrome are shocking!
Firefox works much better for printing, but it works much slower.
wkdmarty
source share