Skip to content

Apple · iPhone · 2020

iPhone 12 Screen Size & CSS Viewport

iPhone 12 CSS viewport measures 390 × 844 pixels with 1170 × 2532 physical resolution and 3x pixel density.

CSS Viewport

390 × 844

Physical Pixels

1170 × 2532

Pixel Ratio (DPR)

3x (460 PPI)

Screen Size

6.1" (19.5:9)

Safe Area Insets

47px / 34px

Tailwind Prefix

Default (< 640px sm)

Scaled Viewport Preview
top 47px
390 × 844Portrait · 3x
bottom 34px

First iPhone generation to adopt the 390 × 844 CSS viewport with a 47px top notch safe area.

Copy-paste CSS

iPhone 12 CSS media queries & safe areas

Use content-based responsive breakpoints first, and reach for these snippets when auditing device-specific edge cases.

Responsive max-width query

/* iPhone 12 Portrait (390x844, 3x) */
@media only screen and (max-width: 390px) {
  /* styles for iPhone 12 and narrower viewports */
}

Exact device & DPR query

/* Target iPhone 12 specifically (390px width, 3x DPR) */
@media only screen
  and (device-width: 390px)
  and (device-height: 844px)
  and (-webkit-min-device-pixel-ratio: 3) {
  /* device-specific overrides */
}

Safe-area inset helpers

/* iPhone 12 safe-area padding (top 47px, bottom 34px) */
.sticky-header {
  padding-top: env(safe-area-inset-top, 47px);
}
.sticky-footer {
  padding-bottom: env(safe-area-inset-bottom, 34px);
}

Frontend QA notes

What breaks most often on iPhone 12

Browser environment: iOS Safari (WebKit) · Mobile.

  • Test CSS Grid/Flexbox fallback spacing and WebP/AVIF decoding on older iOS devices still active in consumer traffic.

Side-by-side

Compare iPhone 12 with nearby devices

Check how viewport width and pixel ratio shift across adjacent models.

DeviceViewportPhysicalDPR
iPhone 12390 × 8441170 × 25323x
iPhone 13390 × 8441170 × 25323x
iPhone 14390 × 8441170 × 25323x
iPhone SE375 × 667750 × 13342x

Test iPhone 12 + 50 devices side by side

Stop resizing Chrome DevTools one viewport at a time. Sizzy renders iPhone 12, narrow 360px Android, iPad, and desktop simultaneously with synced scrolling, unified console, and one-click device screenshots.

Questions

iPhone 12 viewport questions

  • The iPhone 12 CSS viewport size is 390 × 844 pixels in portrait (844 × 390 pixels in landscape).