<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: David Brooks</title>
    <description>The latest articles on DEV Community by David Brooks (@screensizecom).</description>
    <link>https://dev.to/screensizecom</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4229423%2Fe40e2fa9-f1b4-44c8-b87f-1675ccd912be.png</url>
      <title>DEV Community: David Brooks</title>
      <link>https://dev.to/screensizecom</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/screensizecom"/>
    <language>en</language>
    <item>
      <title>CSS Pixels vs Device Pixels: Why "It Looks Fine on My Monitor" Is a Bug Report</title>
      <dc:creator>David Brooks</dc:creator>
      <pubDate>Fri, 06 Nov 2026 00:45:57 +0000</pubDate>
      <link>https://dev.to/screensizecom/css-pixels-vs-device-pixels-why-it-looks-fine-on-my-monitor-is-a-bug-report-1c80</link>
      <guid>https://dev.to/screensizecom/css-pixels-vs-device-pixels-why-it-looks-fine-on-my-monitor-is-a-bug-report-1c80</guid>
      <description>&lt;p&gt;Most layout bugs are not bugs. They're mismatches between the viewport we designed on and the viewport someone else is using.&lt;/p&gt;

&lt;p&gt;Here's the thing that trips people up: &lt;strong&gt;a phone can report a 412 CSS-pixel-wide screen while being physically half the size of your laptop&lt;/strong&gt;, and a 4K monitor at 200% scaling gives you &lt;em&gt;exactly the same&lt;/em&gt; usable width as a 1080p one. Resolution and viewport are not the same number, and treating them as one is where "it works on my machine" comes from.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three numbers that get confused
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Number&lt;/th&gt;
&lt;th&gt;What it really means&lt;/th&gt;
&lt;th&gt;Where you see it&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Physical resolution&lt;/td&gt;
&lt;td&gt;Actual pixel count of the panel, e.g. 3840×2160&lt;/td&gt;
&lt;td&gt;Product specs, OS display settings&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CSS viewport width&lt;/td&gt;
&lt;td&gt;What &lt;code&gt;window.innerWidth&lt;/code&gt; reports after scaling and zoom&lt;/td&gt;
&lt;td&gt;DevTools device mode, media queries&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Device pixel ratio&lt;/td&gt;
&lt;td&gt;Physical pixels per CSS pixel (1, 1.25, 1.5, 2, 3)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;window.devicePixelRatio&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A &lt;strong&gt;27" 1440p monitor at 100%&lt;/strong&gt; gives you roughly 2560 CSS pixels to play with. A &lt;strong&gt;15" laptop at 1920×1080 and 150% scaling&lt;/strong&gt; gets 1280. A &lt;strong&gt;common Android phone&lt;/strong&gt; gets somewhere around 360–412. Those are three wildly different layouts, and none of them tell you how big the screen physically is.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why 1920 already equals 4K
&lt;/h2&gt;

&lt;p&gt;Once you account for scaling, a 4K panel at 200% has a 1920×1080 CSS viewport — the same layout budget as a plain 1080p screen. So "we tested on 4K" is not a wider test than "we tested on 1080p". If you want the &lt;em&gt;wide&lt;/em&gt; end of the curve you need an ultrawide (3440 or 5120 physical) or a monitor at 100% scaling.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Print the real numbers of whatever device you're on&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;cssWidth&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerWidth&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;cssHeight&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerHeight&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;dpr&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;devicePixelRatio&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;physicalWidth&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerWidth&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;devicePixelRatio&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run that on a phone, a laptop and your desk monitor. The spread in &lt;code&gt;cssWidth&lt;/code&gt; is usually much smaller than people expect, and the spread in physical size is much larger.&lt;/p&gt;

&lt;h2&gt;
  
  
  The five profiles that catch the most layout problems
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;1366×768&lt;/strong&gt; — still common in offices, education and cheap laptops. Catches overflowing navs and fixed-height hero sections.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;1920×1080 at 125–150% scaling&lt;/strong&gt; — the "high-DPI laptop": effectively 1280–1536 CSS px.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;2560×1440 at 100%&lt;/strong&gt; — the desktop default; the width most designs are actually drawn for.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;3440×1440 ultrawide&lt;/strong&gt; — catches max-width-less layouts stretching into unreadable line lengths.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;390×844 (phone)&lt;/strong&gt; — plus one &lt;em&gt;small&lt;/em&gt; Android around 360 px, which is stricter than the iPhone.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That's five checkpoints instead of infinite combinations, and it covers the four scaling regimes plus both extremes of width.&lt;/p&gt;

&lt;h2&gt;
  
  
  Turning it into a repeatable check
&lt;/h2&gt;

&lt;p&gt;Manual resizing is a good start, but the useful version is deliberate and repeatable:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fix the profile list in the project, not in someone's head, so every release is measured the same way.&lt;/li&gt;
&lt;li&gt;Record the &lt;strong&gt;viewport&lt;/strong&gt; next to every screenshot in bug reports. A screenshot without a viewport is only half a bug.&lt;/li&gt;
&lt;li&gt;Compare &lt;em&gt;across&lt;/em&gt; profiles: if a heading wraps differently on two screens, that's a layout rule, not a mystery.&lt;/li&gt;
&lt;li&gt;Watch device pixel ratio when testing text and icons: at DPR 1.5 and 2, hairline borders and 1px icons start to disappear.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you just need the raw numbers while deciding on a target, &lt;a href="https://screensizecomparison.org" rel="noopener noreferrer"&gt;Screen Size Comparison&lt;/a&gt; compares screen sizes and resolutions side by side — useful for sanity-checking what CSS width a given physical panel will actually give you.&lt;/p&gt;

&lt;h2&gt;
  
  
  The takeaway
&lt;/h2&gt;

&lt;p&gt;Resolution is a spec sheet number. The viewport is what your CSS sees. Design and test against the viewport, pick five profiles that span the real world, and write the viewport down next to every screenshot — the "works on my monitor" class of bugs mostly disappears on its own.&lt;/p&gt;

</description>
      <category>css</category>
      <category>ux</category>
      <category>r</category>
    </item>
    <item>
      <title>A quick way to compare screen sizes and resolutions side by side</title>
      <dc:creator>David Brooks</dc:creator>
      <pubDate>Fri, 06 Nov 2026 00:02:19 +0000</pubDate>
      <link>https://dev.to/screensizecom/a-quick-way-to-compare-screen-sizes-and-resolutions-side-by-side-ia</link>
      <guid>https://dev.to/screensizecom/a-quick-way-to-compare-screen-sizes-and-resolutions-side-by-side-ia</guid>
      <description>&lt;p&gt;When I'm designing for multiple devices, the part that slows me down most is the boring arithmetic: is a 6.1" phone really smaller than a 6.7" one? How much narrower is a 13" laptop than a 15.6" one? How do pixel densities compare once you stop trusting the "inches" number?&lt;/p&gt;

&lt;p&gt;I've been using &lt;a href="https://screensizecomparison.org" rel="noopener noreferrer"&gt;Screen Size Comparison&lt;/a&gt; for this. You pick two devices and it shows their physical dimensions, diagonal, and resolution next to each other, so you can eyeball the difference instead of converting units in your head.&lt;/p&gt;

&lt;p&gt;A few things that surprised me:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Diagonal inches hide aspect ratio.&lt;/strong&gt; A 16:9 and a 3:2 panel with the same diagonal have noticeably different width and height, which matters as soon as you're planning layout breakpoints.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Bigger diagonal doesn't always mean more pixels.&lt;/strong&gt; Resolution and PPI are separate numbers; a low-density big screen can look worse than a dense small one.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ratios are easier to reason about than absolute sizes.&lt;/strong&gt; Once you know that two screens are within a few percent of each other in width, the "which is wider" question mostly goes away.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It's free and needs no account. If you keep a device matrix in your design system, it's a handy reference to link next to it.&lt;/p&gt;

&lt;p&gt;What's your usual workflow for picking breakpoints across devices?&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>design</category>
      <category>ux</category>
    </item>
  </channel>
</rss>
