#CSS pixel

screen.width is still useless

In a 2013 article, Peter-Paul Koch concluded that “screen.width/height is completely unreliable.” The main reason being that some browsers provide values in physical pixels, while others measure “the width and height of the ideal viewport; the one you get when using width=device-width.” Which option is the preferred one? Is there an “official” definition? Currently there … mehr