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)
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.
| Device | Viewport | Physical | DPR |
|---|---|---|---|
| iPhone 12 | 390 × 844 | 1170 × 2532 | 3x |
| iPhone 13 | 390 × 844 | 1170 × 2532 | 3x |
| iPhone 14 | 390 × 844 | 1170 × 2532 | 3x |
| iPhone SE | 375 × 667 | 750 × 1334 | 2x |
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).
The iPhone 12 has a physical screen resolution of 1170 × 2532 pixels on a 6.1" display (460 PPI) with a 3x device pixel ratio.
Use @media only screen and (max-width: 390px) for responsive width targeting, or combine (device-width: 390px) and (-webkit-min-device-pixel-ratio: 3) for high-DPI styling.
You can preview your local site at 390 × 844 alongside other phones, tablets, and desktop viewports simultaneously inside Sizzy, with synced scroll, DevTools, and screenshot capture.