Characteristics of the Google Pixel 4 XL

Résolution du viewport CSS mobile

Viewport resolution (CSS rules)

It is the resolution that interests designers and developers the most because it determines the breakpoints and the definition of media queries. In general we only talk about this resolution.
For the Google Pixel 4 XL it is :

  • 412 pixels width
  • 869 pixels height ⚠️ the height is indicative because the Safari browser, Chrome, etc. reduce the visible area

ℹ️ Some analytics tools only display the manufacturer resolution (below) and not the one presented above, so be careful when interpreting the results.


Pixel density

On the Google Pixel 4 XL it is 3.5

If you want to target devices with at least this pixel density in CSS, you can use this media query.

                        
                            @media only screen and (-webkit-min-device-pixel-ratio: 3.5) {
    /* CSS */
}

Also in javascript, it is possible to retrieve the value of the pixel density.

                        
                            window.devicePixelRatio
// Which will return the figure 3.5

Manufacturer resolution Google Pixel 4 XL

Given the pixel density this gives:

  • 1440 pixels width
  • 3040 pixels height