<?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: petermcclung</title>
    <description>The latest articles on DEV Community by petermcclung (@petermcclung).</description>
    <link>https://dev.to/petermcclung</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3710217%2F3b0342c2-e24b-4d5b-ae6d-08386c8430cb.jpeg</url>
      <title>DEV Community: petermcclung</title>
      <link>https://dev.to/petermcclung</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/petermcclung"/>
    <language>en</language>
    <item>
      <title>The iOS Safari Full-Height Video Fix That Actually Works (After 4 Hours of Everything That Doesn't)</title>
      <dc:creator>petermcclung</dc:creator>
      <pubDate>Wed, 14 Jan 2026 06:05:31 +0000</pubDate>
      <link>https://dev.to/petermcclung/the-ios-safari-full-height-video-fix-that-actually-works-after-4-hours-of-everything-that-doesnt-1iim</link>
      <guid>https://dev.to/petermcclung/the-ios-safari-full-height-video-fix-that-actually-works-after-4-hours-of-everything-that-doesnt-1iim</guid>
      <description>&lt;p&gt;If you've tried to make a full-screen hero video work on iOS Safari, you've probably spent hours reading the same recycled advice that doesn't actually solve the problem. I just burned an afternoon on this, so let me save you the pain.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The problem:&lt;/strong&gt; You want a background video that fills the entire screen on an iPhone. The bottom keeps getting cut off, or there's a gap, or the content below the fold is hidden behind Safari's toolbar. You Google it. You find 50 articles. None of them work.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What the internet tells you to try:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;100vh&lt;/code&gt; — Too tall. Safari calculates this based on the viewport with toolbars hidden, not what the user actually sees.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;100svh&lt;/code&gt; — The "small viewport height" that's supposed to fix this. Doesn't work reliably. Tried it. Multiple times. Different ways.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;100dvh&lt;/code&gt; — The "dynamic viewport height" that updates as toolbars show and hide. Causes layout jank and still didn't solve our problem.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;100lvh&lt;/code&gt; — The "large viewport height." Gets closer but still came up short on our iPhone 16 Pro Max.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-webkit-fill-available&lt;/code&gt; — Only works on WebKit, breaks Chrome, doesn't work when nested, and half the implementations out there are wrong anyway.&lt;/li&gt;
&lt;li&gt;JavaScript solutions using &lt;code&gt;window.innerHeight&lt;/code&gt; — Same problem. &lt;code&gt;innerHeight&lt;/code&gt; gives you the &lt;em&gt;current&lt;/em&gt; visible height, which is the short one. You're back where you started.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;env(safe-area-inset-bottom)&lt;/code&gt; with &lt;code&gt;viewport-fit=cover&lt;/code&gt; — Useful for padding content away from the notch and home bar, but doesn't fix the fundamental height issue.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I tried all of these. I tried combining them. I tried the "triple fallback" approach with CSS custom properties. I probably went through 10-12 iterations over three or four hours. The video kept coming up short on taller phones.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What actually worked:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.hero&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;min-height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;calc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;100&lt;/span&gt;&lt;span class="n"&gt;lvh&lt;/span&gt; &lt;span class="err"&gt;+&lt;/span&gt; &lt;span class="m"&gt;60px&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;That's it. Make it too tall on purpose. Then adjust your content positioning to account for it — we bumped bottom-positioned elements from &lt;code&gt;bottom: 15%&lt;/code&gt; to &lt;code&gt;bottom: 25%&lt;/code&gt; on mobile so they sit comfortably in the visible area on initial load.&lt;/p&gt;

&lt;p&gt;Is this elegant? No. Does it feel like a hack? Absolutely. But here's the thing: users don't see your CSS. They see whether your hero video fills their screen or looks broken. "Too tall" means they scroll past it by a few pixels and never notice. "Too short" means the first thing they see is a janky, cut-off hero that makes your site look amateur.&lt;/p&gt;

&lt;p&gt;The web development community keeps chasing spec-compliant solutions that Apple keeps breaking with every iOS release. Meanwhile, the simple answer — just add some extra height and adjust your content — isn't anywhere in the search results because it doesn't feel like a "real" solution. But it ships. It works across devices. And it took 30 seconds to implement after we stopped trying to do it the "right" way.&lt;/p&gt;

&lt;p&gt;If you're stuck on this problem, stop fighting Safari's viewport quirks. Make your hero too tall, push your content into the visible area, and move on. You've got better things to build.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;I'm not claiming this is the best solution — just the one that actually worked after a frustrating afternoon. If you've found something cleaner that reliably works across iOS devices, drop it in the comments. I'd genuinely love to be proven wrong on this one.&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;That should do it. Good luck — hopefully it helps some people and maybe someone does have a better answer buried somewhere.&lt;/p&gt;

&lt;p&gt;Update (Feb 2026): &lt;br&gt;
After shipping this fix on multiple projects, I should clarify the window.innerHeight approach. It's not a failure — it actually works well when you need the hero to fill exactly the visible viewport (pixel-perfect). The reason I moved past it is that it returns the "short" measurement (with toolbars visible), so when Safari's toolbar auto-hides, the hero can feel slightly short. calc(100lvh + 60px) is the better choice specifically for video heroes where a little extra scrollable height is invisible to the user. &lt;/p&gt;

</description>
      <category>webdev</category>
      <category>css</category>
      <category>safari</category>
      <category>ios</category>
    </item>
  </channel>
</rss>
