<?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: Pixel Recruiting LLC</title>
    <description>The latest articles on DEV Community by Pixel Recruiting LLC (@pixelrecruiting).</description>
    <link>https://dev.to/pixelrecruiting</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%2F4209609%2Fc7e5d4fb-0d23-40b0-96ac-7c189e9bc927.png</url>
      <title>DEV Community: Pixel Recruiting LLC</title>
      <link>https://dev.to/pixelrecruiting</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/pixelrecruiting"/>
    <language>en</language>
    <item>
      <title>Cancel Submitted the Form? A Button With No type Attribute Is a Submit Button</title>
      <dc:creator>Pixel Recruiting LLC</dc:creator>
      <pubDate>Wed, 18 Nov 2026 13:46:20 +0000</pubDate>
      <link>https://dev.to/pixelrecruiting/cancel-submitted-the-form-a-button-with-no-type-attribute-is-a-submit-button-bne</link>
      <guid>https://dev.to/pixelrecruiting/cancel-submitted-the-form-a-button-with-no-type-attribute-is-a-submit-button-bne</guid>
      <description>&lt;p&gt;A user opens an edit form and types a new name. Then they change their mind and click Cancel. The page reloads, the field is empty, and the address bar now ends in &lt;code&gt;?name=...&lt;/code&gt;. Cancel did not cancel. It sent the form.&lt;/p&gt;

&lt;p&gt;Nothing is wrong with the click handler. The button itself has a default job, and that job is "submit."&lt;/p&gt;

&lt;h2&gt;
  
  
  The markup
&lt;/h2&gt;

&lt;p&gt;Here is a small edit form. Cancel is meant to close it. Save is meant to send it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;form&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"edit"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;label&amp;gt;&lt;/span&gt;Name &lt;span class="nt"&gt;&amp;lt;input&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"name"&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"name"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/label&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"cancel"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Cancel&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"save"&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"submit"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Save&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"cancel"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"click"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;closeEditor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&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;Save says &lt;code&gt;type="submit"&lt;/code&gt;. Cancel says nothing at all. That missing attribute is the whole bug.&lt;/p&gt;

&lt;h2&gt;
  
  
  What we saw in Chrome
&lt;/h2&gt;

&lt;p&gt;We ran this in headless Chrome 156 on November 16, 2026. We typed "Ana Lima" into the field and clicked Cancel.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The click handler ran, and then the form was submitted.&lt;/li&gt;
&lt;li&gt;The page navigated to &lt;code&gt;reload.html?name=Ana+Lima&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;After the reload, the field was empty and the page was back to its starting state.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then we added &lt;code&gt;type="button"&lt;/code&gt; to Cancel and ran it again. The click handler ran. There was no navigation, and "Ana Lima" stayed in the field.&lt;/p&gt;

&lt;p&gt;We also logged &lt;code&gt;event.submitter&lt;/code&gt; in a &lt;code&gt;submit&lt;/code&gt; listener. That property names the button that started the submit. For the first form, it named Cancel.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Enter key can press Cancel too
&lt;/h2&gt;

&lt;p&gt;This part surprises people more. We put the cursor in the text field and pressed Enter. Chrome fired a &lt;code&gt;click&lt;/code&gt; on Cancel, not on Save. The form was then submitted with Cancel as the submitter.&lt;/p&gt;

&lt;p&gt;The reason is the "default button." The HTML standard says it is the first submit button in tree order, which means source order. When a user submits a form with Enter, the browser fires a click on that default button. MDN's page on the &lt;code&gt;submit&lt;/code&gt; event says the same.&lt;/p&gt;

&lt;p&gt;Cancel had no &lt;code&gt;type&lt;/code&gt;, so it counted as a submit button. It came before Save in the markup, so it became the default button. Any code in its click handler ran on Enter.&lt;/p&gt;

&lt;p&gt;With &lt;code&gt;type="button"&lt;/code&gt; on Cancel, Enter clicked Save instead. That is what most people expect.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why a plain &lt;code&gt;&amp;lt;button&amp;gt;&lt;/code&gt; submits
&lt;/h2&gt;

&lt;p&gt;MDN's &lt;code&gt;&amp;lt;button&amp;gt;&lt;/code&gt; page lists three values for &lt;code&gt;type&lt;/code&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;submit&lt;/code&gt; sends the form. It is the default when the attribute is missing on a button tied to a form. It is also the default for an empty or invalid value.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;reset&lt;/code&gt; puts every field back to its starting value.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;button&lt;/code&gt; has no built-in action. Only your own scripts do something.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The same page has a plain warning. If a button is not for sending form data, set its &lt;code&gt;type&lt;/code&gt; to &lt;code&gt;button&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Our Chrome test matched each of these points:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;type=""&lt;/code&gt; submitted the form.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;type="cancel"&lt;/code&gt;, which is not a real value, submitted the form.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;type="BUTTON"&lt;/code&gt; in capitals did not submit. The value is not case-sensitive.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;type="reset"&lt;/code&gt; cleared the field back to its starting text.&lt;/li&gt;
&lt;li&gt;Reading &lt;code&gt;.type&lt;/code&gt; in JavaScript gave &lt;code&gt;"submit"&lt;/code&gt; for a button with no attribute, an empty value, or an invalid value.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Outside a form, and the &lt;code&gt;form&lt;/code&gt; attribute
&lt;/h2&gt;

&lt;p&gt;A button with no &lt;code&gt;type&lt;/code&gt; that sits outside every form did not submit anything in our test. Its &lt;code&gt;.type&lt;/code&gt; still read &lt;code&gt;"submit"&lt;/code&gt;. There was simply no form to send.&lt;/p&gt;

&lt;p&gt;That changes if the button points at a form with the &lt;code&gt;form&lt;/code&gt; attribute. We placed a typeless button outside the form and gave it &lt;code&gt;form="fE"&lt;/code&gt;. Clicking it submitted that form. So "it is not inside the form" is not proof that it is safe.&lt;/p&gt;

&lt;h2&gt;
  
  
  The fix
&lt;/h2&gt;

&lt;p&gt;Give every button an explicit &lt;code&gt;type&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;form&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"edit"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;label&amp;gt;&lt;/span&gt;Name &lt;span class="nt"&gt;&amp;lt;input&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"name"&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"name"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/label&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"cancel"&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"button"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Cancel&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"save"&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"submit"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Save&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Some teams call &lt;code&gt;event.preventDefault()&lt;/code&gt; inside the Cancel click handler instead. That stops the submit, but the button is still a submit button. If Cancel comes first, Enter still runs the Cancel handler. We tested that too. Enter ran the Cancel code, and Save was never clicked. The &lt;code&gt;type&lt;/code&gt; fix removes the cause, not just the symptom.&lt;/p&gt;

&lt;h2&gt;
  
  
  A short checklist
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Inside a form, a &lt;code&gt;&amp;lt;button&amp;gt;&lt;/code&gt; with no &lt;code&gt;type&lt;/code&gt; behaves like &lt;code&gt;type="submit"&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;An empty or misspelled &lt;code&gt;type&lt;/code&gt; behaves the same way.&lt;/li&gt;
&lt;li&gt;Enter in a text field clicks the first submit button in the form. Check which button that is.&lt;/li&gt;
&lt;li&gt;A button outside the form can still submit it through the &lt;code&gt;form&lt;/code&gt; attribute.&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;type="button"&lt;/code&gt; for Cancel, Close, Show password, Add row, and every other button that should not send data.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;On MDN, the &lt;code&gt;&amp;lt;button&amp;gt;&lt;/code&gt; element is marked Baseline widely available from July 2015. &lt;code&gt;SubmitEvent.submitter&lt;/code&gt; is marked Baseline widely available from March 2022.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;MDN, the button element: &lt;a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/button" rel="noopener noreferrer"&gt;https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/button&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;MDN, HTMLButtonElement type property: &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLButtonElement/type" rel="noopener noreferrer"&gt;https://developer.mozilla.org/en-US/docs/Web/API/HTMLButtonElement/type&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;MDN, HTMLFormElement submit event: &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/submit_event" rel="noopener noreferrer"&gt;https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/submit_event&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;MDN, SubmitEvent submitter property: &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/SubmitEvent/submitter" rel="noopener noreferrer"&gt;https://developer.mozilla.org/en-US/docs/Web/API/SubmitEvent/submitter&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;HTML Living Standard, implicit submission: &lt;a href="https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#implicit-submission" rel="noopener noreferrer"&gt;https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#implicit-submission&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;PIXEL RECRUITING LLC introduces frontend and UI engineers to product teams that care about details like this one. We mean a Cancel button that really cancels, even when someone presses Enter. We are a direct staffing partner for Mastercard in O'Fallon, MO. Learn more at &lt;a href="https://pixelrecruiting.com" rel="noopener noreferrer"&gt;pixelrecruiting.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>html</category>
      <category>javascript</category>
      <category>frontend</category>
      <category>webdev</category>
    </item>
    <item>
      <title>A Full-Page Overlay That Only Covers a Card? Check the Parent for transform</title>
      <dc:creator>Pixel Recruiting LLC</dc:creator>
      <pubDate>Mon, 16 Nov 2026 14:03:38 +0000</pubDate>
      <link>https://dev.to/pixelrecruiting/a-full-page-overlay-that-only-covers-a-card-check-the-parent-for-transform-nnh</link>
      <guid>https://dev.to/pixelrecruiting/a-full-page-overlay-that-only-covers-a-card-check-the-parent-for-transform-nnh</guid>
      <description>&lt;p&gt;A share dialog is supposed to dim the whole page. You give the dimmed backdrop &lt;code&gt;position: fixed&lt;/code&gt; and &lt;code&gt;inset: 0&lt;/code&gt;. That combination usually covers the window. Instead, the dimming sits only on one card. The rest of the page stays bright and clickable.&lt;/p&gt;

&lt;p&gt;The overlay is not broken. It is obeying a different containing block. A parent, often one with a small &lt;code&gt;transform&lt;/code&gt; used to lift the card, has become the reference for &lt;code&gt;fixed&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The layout
&lt;/h2&gt;

&lt;p&gt;A card lifts a little on hover. The share overlay is rendered inside the card, because that is where the button lives.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;section&lt;/span&gt; &lt;span class="na"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"card"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;Quarterly report&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"button"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Share&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"overlay"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"dialog"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Share this file&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/section&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.card&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nt"&gt;hover&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="nc"&gt;.card.is-open&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;transform&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;translateY&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;-8px&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.overlay&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;fixed&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;inset&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;rgb&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mf"&gt;0.4&lt;/span&gt;&lt;span class="p"&gt;)&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;When the card is open, or hovered, the overlay covers only the card.&lt;/p&gt;

&lt;h2&gt;
  
  
  What we measured
&lt;/h2&gt;

&lt;p&gt;We tested this in Chrome 156 on November 13, 2026. A 240 by 160 pixel card sat on an 800-pixel-wide page. The overlay used &lt;code&gt;position: fixed; inset: 0&lt;/code&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;With no &lt;code&gt;transform&lt;/code&gt; on the card, or with &lt;code&gt;transform: none&lt;/code&gt;, the overlay sat at the top left of the viewport and covered the window.&lt;/li&gt;
&lt;li&gt;With &lt;code&gt;transform: translateY(-8px)&lt;/code&gt;, the overlay sat on the card. Its box matched the card's inner size, 236 by 156 pixels, which is the card minus its 2-pixel border.&lt;/li&gt;
&lt;li&gt;The same card-sized result appeared with &lt;code&gt;transform: translate(0, 0)&lt;/code&gt;. A move of zero was enough.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That last case is the one that is easy to miss. A "do nothing" transform still counts.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why &lt;code&gt;fixed&lt;/code&gt; leaves the viewport
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;position: fixed&lt;/code&gt; is described, in everyday use, as "relative to the viewport." MDN's page on &lt;code&gt;position&lt;/code&gt; gives the fuller rule. The containing block is the viewport, unless an ancestor has &lt;code&gt;transform&lt;/code&gt;, &lt;code&gt;perspective&lt;/code&gt;, or &lt;code&gt;filter&lt;/code&gt; set to a value other than &lt;code&gt;none&lt;/code&gt;. That ancestor then becomes the containing block. MDN also says that &lt;code&gt;will-change: transform&lt;/code&gt; establishes a new containing block.&lt;/p&gt;

&lt;p&gt;CSS Position Level 3 lists properties that can make a box a fixed-position containing block. It names &lt;code&gt;transform&lt;/code&gt;, &lt;code&gt;will-change&lt;/code&gt;, and &lt;code&gt;contain&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Our Chrome tests matched those documents:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;filter: brightness(1)&lt;/code&gt; (a visual no-op) pinned the overlay to the card.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;will-change: transform&lt;/code&gt; did the same.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;contain: paint&lt;/code&gt; did the same.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;perspective: 500px&lt;/code&gt; did the same.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;will-change: opacity&lt;/code&gt; did &lt;strong&gt;not&lt;/strong&gt;. The overlay covered the viewport, as it did with no transform. That fits MDN, which names &lt;code&gt;will-change: transform&lt;/code&gt;, not every &lt;code&gt;will-change&lt;/code&gt; value.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The fix: move the overlay, or move the transform
&lt;/h2&gt;

&lt;p&gt;The overlay has to live outside the element that creates the containing block.&lt;/p&gt;

&lt;p&gt;The most direct approach is to render the overlay as a child of &lt;code&gt;document.body&lt;/code&gt;, not inside the card. A UI library's "portal" does this. After the move, &lt;code&gt;position: fixed; inset: 0&lt;/code&gt; refers to the viewport again. That holds as long as no other ancestor on the way up has &lt;code&gt;transform&lt;/code&gt;, &lt;code&gt;filter&lt;/code&gt;, &lt;code&gt;perspective&lt;/code&gt;, &lt;code&gt;will-change: transform&lt;/code&gt;, or &lt;code&gt;contain: paint&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;If the lift effect is the only reason for the transform, apply it to an inner element, and keep the overlay outside that inner element:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;section&lt;/span&gt; &lt;span class="na"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"card"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"card-face"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;Quarterly report&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"button"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Share&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/section&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.card&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nt"&gt;hover&lt;/span&gt; &lt;span class="nc"&gt;.card-face&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="nc"&gt;.card.is-open&lt;/span&gt; &lt;span class="nc"&gt;.card-face&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;transform&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;translateY&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;-8px&lt;/span&gt;&lt;span class="p"&gt;)&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;The card wrapper itself has no &lt;code&gt;transform&lt;/code&gt;. An overlay that is a sibling of &lt;code&gt;.card-face&lt;/code&gt;, or a child of &lt;code&gt;body&lt;/code&gt;, is not trapped by the lift.&lt;/p&gt;

&lt;p&gt;Do not rely on "resetting" the parent with &lt;code&gt;transform: none&lt;/code&gt; if some other code then sets &lt;code&gt;translate(0, 0)&lt;/code&gt;. As our test showed, a zero translate still creates the containing block.&lt;/p&gt;

&lt;h2&gt;
  
  
  A short checklist
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;position: fixed; inset: 0&lt;/code&gt; covers the window only when the containing block is the viewport.&lt;/li&gt;
&lt;li&gt;Inspect ancestors for &lt;code&gt;transform&lt;/code&gt;, &lt;code&gt;filter&lt;/code&gt;, or &lt;code&gt;perspective&lt;/code&gt; values other than &lt;code&gt;none&lt;/code&gt;, for &lt;code&gt;will-change: transform&lt;/code&gt;, and for &lt;code&gt;contain: paint&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;A zero translate, or a &lt;code&gt;filter&lt;/code&gt; that does not change the look, is enough.&lt;/li&gt;
&lt;li&gt;Move the overlay out of that ancestor, or move the &lt;code&gt;transform&lt;/code&gt; onto an inner wrapper that does not wrap the overlay.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;On MDN, &lt;code&gt;position&lt;/code&gt; is marked Baseline widely available from July 2015, and &lt;code&gt;transform&lt;/code&gt; from September 2015.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;MDN, position: &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/position" rel="noopener noreferrer"&gt;https://developer.mozilla.org/en-US/docs/Web/CSS/position&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;MDN, transform: &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/transform" rel="noopener noreferrer"&gt;https://developer.mozilla.org/en-US/docs/Web/CSS/transform&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;W3C CSS Positioned Layout Module Level 3: &lt;a href="https://www.w3.org/TR/css-position-3/" rel="noopener noreferrer"&gt;https://www.w3.org/TR/css-position-3/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;W3C CSS Transforms Module Level 1: &lt;a href="https://www.w3.org/TR/css-transforms-1/" rel="noopener noreferrer"&gt;https://www.w3.org/TR/css-transforms-1/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;PIXEL RECRUITING LLC introduces frontend and UI engineers to product teams that care about details like this one. We mean a modal that really covers the page, not only the card that opened it. We are a direct staffing partner for Mastercard in O'Fallon, MO. Learn more at &lt;a href="https://pixelrecruiting.com" rel="noopener noreferrer"&gt;pixelrecruiting.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>css</category>
      <category>frontend</category>
      <category>layout</category>
      <category>html</category>
    </item>
    <item>
      <title>Cap-Gap Can Run Until April 1. Who Qualifies, and Who Can Keep Working</title>
      <dc:creator>Pixel Recruiting LLC</dc:creator>
      <pubDate>Mon, 16 Nov 2026 06:08:23 +0000</pubDate>
      <link>https://dev.to/pixelrecruiting/cap-gap-can-run-until-april-1-who-qualifies-and-who-can-keep-working-k6c</link>
      <guid>https://dev.to/pixelrecruiting/cap-gap-can-run-until-april-1-who-qualifies-and-who-can-keep-working-k6c</guid>
      <description>&lt;p&gt;If you are on OPT, a cap-subject H-1B petition may be filed for you. There can be a gap between the day your OPT ends and the day H-1B work may start. A rule called cap-gap is meant to fill that gap. Since January 17, 2025, that automatic extension can last through April 1 of the H-1B fiscal year. If the approved petition has an earlier start date, the extension lasts only through that date. Before the 2025 change, the extension stopped on October 1.&lt;/p&gt;

&lt;p&gt;We last checked this on November 16, 2026. Our sources were the USCIS cap-gap page (last reviewed January 17, 2025) and the 2024 final rule that made the April 1 change.&lt;/p&gt;

&lt;h2&gt;
  
  
  The short answer
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Cap-gap can automatically extend F-1 status, and in many cases OPT work permission, after the usual end date.&lt;/li&gt;
&lt;li&gt;It applies only to a &lt;strong&gt;cap-subject&lt;/strong&gt; H-1B petition that is properly and timely filed. That petition must also ask USCIS to &lt;strong&gt;change your status&lt;/strong&gt;, not only to seek a visa at a consulate.&lt;/li&gt;
&lt;li&gt;If the petition is approved, the extension continues through &lt;strong&gt;April 1&lt;/strong&gt; of the fiscal year named in the petition. If the approved start date comes sooner, the extension lasts only through that date.&lt;/li&gt;
&lt;li&gt;The extension stops in these cases:

&lt;ul&gt;
&lt;li&gt;USCIS denies the petition.&lt;/li&gt;
&lt;li&gt;The petition is withdrawn, revoked, rejected, or not selected.&lt;/li&gt;
&lt;li&gt;The request to change status is refused or pulled back.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;You do not file a new form or get a new work card for cap-gap itself. A fresh I-20 issued by your school official serves as evidence. USCIS says you do not need that I-20 in order to keep working; it is evidence of the extension.&lt;/li&gt;
&lt;li&gt;If the petition is filed only after you have entered the F-1 60-day departure period, USCIS says your F-1 status can extend. You may not work, though. That is because you were not authorized to work when the petition was filed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Some terms first:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cap-subject H-1B&lt;/strong&gt;: a petition that counts against the annual H-1B numerical cap.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Change of status&lt;/strong&gt;: a request, in the H-1B petition, to move from F-1 to H-1B without leaving the country. This is not the same as departing to pick up an H-1B visa at a U.S. consulate.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DSO&lt;/strong&gt;: your school's designated school official, the person who updates your I-20.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;EAD&lt;/strong&gt;: the work card for OPT (employment authorization document).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fiscal year&lt;/strong&gt;: the federal year that starts on October 1. An H-1B cap petition filed in the spring is usually for the fiscal year that starts the following October 1.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why the gap exists
&lt;/h2&gt;

&lt;p&gt;USCIS explains the timing this way. An employer may not file a cap-subject H-1B petition more than six months before the work is needed. The earliest filing date is therefore April 1 for work in the fiscal year that starts October 1. If USCIS approves the petition and the change of status, H-1B work may start on October 1 at the earliest. Many OPT end dates come before that. The "gap" is that stretch in between.&lt;/p&gt;

&lt;h2&gt;
  
  
  Who qualifies
&lt;/h2&gt;

&lt;p&gt;According to the USCIS page, a cap-gap extension is available when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The H-1B petition is cap-subject.&lt;/li&gt;
&lt;li&gt;It is properly and timely filed for an eligible F-1 student.&lt;/li&gt;
&lt;li&gt;It requests a change of status to H-1B, in the fiscal year for which that status is requested.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;"Timely" on that page means two things. The petition was filed in the H-1B filing period, which begins April 1. And it was filed while your authorized F-1 stay was still in effect. That includes time in a full course of study, authorized post-completion OPT, and the 60-day F-1 departure period.&lt;/p&gt;

&lt;p&gt;The same page sets a filing rule for a cap-subject petition. The petition is not properly filed unless it rests on a registration selected for that same person and that same fiscal year. This does not apply if registration itself has been suspended.&lt;/p&gt;

&lt;p&gt;Cap-gap does &lt;strong&gt;not&lt;/strong&gt; apply to cap-exempt H-1B petitions. If you do not qualify, and your authorized stay ends before the H-1B start date, USCIS says you must leave the United States. After that, if a visa is needed, you apply at a consulate. You then seek admission in H-1B status for the dates shown on the approved petition.&lt;/p&gt;

&lt;h2&gt;
  
  
  When the extension starts and ends
&lt;/h2&gt;

&lt;p&gt;USCIS says the automatic extension begins once the petitioner files a proper, on-time change-of-status request. If the petition is approved, the extension runs through April 1 of that H-1B fiscal year. If the start date on the approved petition comes sooner, the extension lasts only through that date.&lt;/p&gt;

&lt;p&gt;That April 1 cutoff is the 2025 change. The H-1B modernization final rule took effect January 17, 2025. It moved the end of the automatic extension from October 1 over to April 1. In the preamble, DHS said the prior regulations stopped the automatic extension on October 1, and that it was moving that cutoff to April 1. USCIS refreshed its cap-gap page on the day the rule took effect.&lt;/p&gt;

&lt;p&gt;The extension stops automatically in these cases:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;USCIS denies the H-1B petition.&lt;/li&gt;
&lt;li&gt;The petition is withdrawn, revoked, rejected, or not selected.&lt;/li&gt;
&lt;li&gt;The request to change status is refused or pulled back.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is true even when the petition itself is approved for consular processing.&lt;/p&gt;

&lt;p&gt;When it stops, USCIS says you have the usual 60-day F-1 departure period. That period is counted from the day the extension ended or your program end date, whichever is later. That 60-day period does &lt;strong&gt;not&lt;/strong&gt; apply if the change of status is denied or revoked because of a status violation, misrepresentation, or fraud. In those cases, USCIS says you must leave at once, and you are not eligible for cap-gap or the 60-day period.&lt;/p&gt;

&lt;h2&gt;
  
  
  Work permission, and a trap in the 60-day F-1 period
&lt;/h2&gt;

&lt;p&gt;If you were on post-completion OPT when the petition was filed, cap-gap can also carry your work permission forward. It does this together with your F-1 status.&lt;/p&gt;

&lt;p&gt;There is a trap. F-1 students who have already entered the 60-day departure period cannot work. If a cap-subject petition is properly filed in that period, USCIS says your F-1 status can still be extended automatically. Work is not allowed, though. That is because you had no work permission at the moment the petition was filed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Proof, travel, and STEM OPT
&lt;/h2&gt;

&lt;p&gt;The extension is automatic. You do not apply for it, and you do not get a new EAD for the extra time. USCIS says the only proof of continued work permission currently available is a fresh I-20 from your DSO that shows the OPT extension. If you want that I-20, you give your DSO evidence that a timely change-of-status petition was filed. That evidence can be a petition copy plus a shipping receipt. Later, you can also give a Form I-797 receipt notice. USCIS says you can keep working while that I-20 is being updated, because the extension itself is automatic.&lt;/p&gt;

&lt;p&gt;On travel, USCIS has a clear rule. Suppose you leave the United States while the H-1B petition and the request to change status are still waiting on a decision. That request will be treated as abandoned. If both have already been approved, USCIS says you may generally travel and seek to come back in F-1 status. To do this, you must return before the H-1B change takes effect (normally October 1). You must also be otherwise admissible. A CBP officer who inspects you on arrival decides whether to admit you.&lt;/p&gt;

&lt;p&gt;If you are eligible for a STEM OPT extension, USCIS says you may apply for it during a cap-gap extension. You may not apply once cap-gap has ended and you have entered the 60-day F-1 departure period.&lt;/p&gt;

&lt;p&gt;The same USCIS page also lists the usual OPT unemployment limits. You may be unemployed as many as 90 days on the first stretch of post-completion OPT. The total is 150 days once the 24-month STEM extension is added.&lt;/p&gt;

&lt;h2&gt;
  
  
  A reminder
&lt;/h2&gt;

&lt;p&gt;PIXEL RECRUITING LLC does not practice law. We staff engineering teams. Treat this article as our reading of a USCIS page and a final rule, not as legal counsel. For dates that belong to your case alone, ask your DSO or a licensed immigration lawyer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;USCIS, "Extension of Post Completion Optional Practical Training (OPT) and F-1 Status for Eligible Students under the H-1B Cap-Gap Regulations" (last reviewed January 17, 2025; fetched November 16, 2026): &lt;a href="https://www.uscis.gov/working-in-the-united-states/temporary-workers/h-1b-specialty-occupations/extension-of-post-completion-optional-practical-training-opt-and-f-1-status-for-eligible-students" rel="noopener noreferrer"&gt;https://www.uscis.gov/working-in-the-united-states/temporary-workers/h-1b-specialty-occupations/extension-of-post-completion-optional-practical-training-opt-and-f-1-status-for-eligible-students&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;DHS final rule, "Modernizing H-1B Requirements, Providing Flexibility in the F-1 Program, and Program Improvements Affecting Other Nonimmigrant Workers," Federal Register, December 18, 2024, document 2024-29354, effective January 17, 2025: &lt;a href="https://www.federalregister.gov/documents/2024/12/18/2024-29354/modernizing-h-1b-requirements-providing-flexibility-in-the-f-1-program-and-program-improvements" rel="noopener noreferrer"&gt;https://www.federalregister.gov/documents/2024/12/18/2024-29354/modernizing-h-1b-requirements-providing-flexibility-in-the-f-1-program-and-program-improvements&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;A number of engineers PIXEL RECRUITING LLC places begin on OPT or STEM OPT. They later move into H-1B, so we keep a close eye on cap-gap dates. PIXEL RECRUITING LLC is a direct staffing partner for Mastercard in O'Fallon, MO. Open roles are at &lt;a href="https://pixelrecruiting.com" rel="noopener noreferrer"&gt;pixelrecruiting.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>immigration</category>
      <category>career</category>
      <category>opt</category>
      <category>h1b</category>
    </item>
    <item>
      <title>DHS Has Proposed Ending the 60-Day Grace Period After an H-1B Job Ends</title>
      <dc:creator>Pixel Recruiting LLC</dc:creator>
      <pubDate>Sun, 15 Nov 2026 13:43:07 +0000</pubDate>
      <link>https://dev.to/pixelrecruiting/dhs-has-proposed-ending-the-60-day-grace-period-after-an-h-1b-job-ends-41de</link>
      <guid>https://dev.to/pixelrecruiting/dhs-has-proposed-ending-the-60-day-grace-period-after-an-h-1b-job-ends-41de</guid>
      <description>&lt;p&gt;If you are on H-1B, a project or job can end before your approved stay ends. Current rules can give you a short window of lawful status. That window is often called the 60-day grace period. In September 2026, DHS proposed to remove it. Public comments closed on November 10, 2026. This is not a final rule, and it changes nothing today.&lt;/p&gt;

&lt;p&gt;We last checked this on November 15, 2026, against the public notice and the current regulation.&lt;/p&gt;

&lt;h2&gt;
  
  
  The short answer
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Today, certain workers, including people on H-1B, can keep lawful status for a short window after the job ends. The regulation allows as many as 60 consecutive days, or through the last day of the approved stay, whichever comes first. This window is available once in each approved stay. DHS can shorten it or drop it.&lt;/li&gt;
&lt;li&gt;You may not work during that window, unless some other work permission applies.&lt;/li&gt;
&lt;li&gt;DHS has &lt;strong&gt;proposed&lt;/strong&gt; to delete this rule. If a final rule later does that, DHS says those workers would have to leave at once when the job ends. They would not have to leave if they have some other lawful basis to remain. They would be treated as out of status starting the day after the job ends.&lt;/li&gt;
&lt;li&gt;This is &lt;strong&gt;not a final rule&lt;/strong&gt;. The current 60-day window is still in the regulations.&lt;/li&gt;
&lt;li&gt;This is also &lt;strong&gt;not&lt;/strong&gt; the 60-day period F-1 students get after they finish their program. That is a different rule.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Some terms first:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;H-1B&lt;/strong&gt;: a temporary U.S. work status for certain specialty jobs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Petitioner&lt;/strong&gt;: the company that files the H-1B petition (Form I-129) for you.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Grace period&lt;/strong&gt; here: a short stretch of lawful status after employment ends, written at 8 CFR 214.1(l)(2). The phrase is "up to" 60 days, not a promise of 60 full days.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DHS&lt;/strong&gt; (Department of Homeland Security) is the federal department. &lt;strong&gt;USCIS&lt;/strong&gt; is the agency in that department that handles these petitions.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What the current rule says
&lt;/h2&gt;

&lt;p&gt;The rule lives at 8 CFR 214.1(l)(2). It covers H-1B workers and their dependents, and it also names E-1 through E-3, H-1B1, L-1, O-1, and TN.&lt;/p&gt;

&lt;p&gt;In plain words, the current text says:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Your status is not treated as broken just from the job ending, when that job was the basis for the status.&lt;/li&gt;
&lt;li&gt;The window lasts as many as 60 consecutive days, or through the last day of the authorized stay, whichever comes first.&lt;/li&gt;
&lt;li&gt;It is available once during each authorized stay.&lt;/li&gt;
&lt;li&gt;DHS may, at its discretion, make this window shorter or take it away.&lt;/li&gt;
&lt;li&gt;Unless other work permission under 8 CFR 274a.12 applies, you may not work during this period.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The notice says this window was added in a 2016 rule, often called the AC21 rule, that took effect on January 17, 2017. DHS says the aim at the time was to give workers a limited amount of flexibility after a job ends. That included room to pursue other immigration options.&lt;/p&gt;

&lt;p&gt;There is a separate, shorter period in 8 CFR 214.1(l)(1). For H-1B and several other classifications, it can add up to 10 days before the approved stay begins and 10 days after it ends. You may not work in those 10-day stretches either, unless other work permission applies. The proposal would not remove this 10-day period.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the proposal would do
&lt;/h2&gt;

&lt;p&gt;On September 11, 2026, USCIS and DHS published a proposed rule in the Federal Register. The official title is "Eliminating the Discretionary 60-Day Grace Period." Document number 2026-18631, 91 FR 57807, docket USCIS-2026-0364, RIN 1615-AD22.&lt;/p&gt;

&lt;p&gt;The proposal would delete paragraph (l)(2) of 8 CFR 214.1 and renumber the paragraph that follows it.&lt;/p&gt;

&lt;p&gt;DHS writes that, under the proposal, H-1B workers and the other statuses named above would no longer receive this window after employment ends. They "would be required to depart immediately unless otherwise authorized to lawfully remain in the United States." They "would be considered to have failed to maintain status starting the day after their employment ends."&lt;/p&gt;

&lt;p&gt;The notice does not name a start date for these changes. A final rule, if one is issued, would have to say when it begins.&lt;/p&gt;

&lt;h2&gt;
  
  
  This is not the F-1 60-day period
&lt;/h2&gt;

&lt;p&gt;F-1 students have a separate period after they complete a program or practical training, commonly called a 60-day grace period for students. That is a different section of the regulations. The proposal we are describing does not remove that F-1 period. If you are on OPT or STEM OPT, do not read this notice as a change to that student window.&lt;/p&gt;

&lt;h2&gt;
  
  
  Comments have closed, and nothing is final
&lt;/h2&gt;

&lt;p&gt;Written comments were due on or before November 10, 2026, by midnight Eastern time, through regulations.gov. That date has passed. As of November 15, 2026, a Federal Register search for this docket returned only the proposed rule. We found no final rule.&lt;/p&gt;

&lt;p&gt;Until a final rule is published and takes effect, the current text of 8 CFR 214.1(l)(2) is what applies.&lt;/p&gt;

&lt;h2&gt;
  
  
  If a job is ending
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Treat the current rule as the one in force.&lt;/strong&gt; The proposal is only a proposal.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Open the official notice.&lt;/strong&gt; The Federal Register link is in the sources list.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Do not assume you will get 60 full days.&lt;/strong&gt; The window is "up to" 60 days, it ends if the approved stay ends sooner, it is once per stay, and DHS can shorten it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Plan work and travel with care.&lt;/strong&gt; The current rule does not let you work in this window unless some other work permission applies.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Talk to a licensed immigration lawyer&lt;/strong&gt; about your own dates, a new petition, or a change of status. A blog post cannot do that job.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  A reminder
&lt;/h2&gt;

&lt;p&gt;PIXEL RECRUITING LLC does not practice law. We staff engineering teams. Treat this article as our reading of a public proposal and the regulation now in force, not as legal counsel. For a decision that affects your status, ask a licensed immigration lawyer who can review your papers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Federal Register document 2026-18631, "Eliminating the Discretionary 60-Day Grace Period," 91 FR 57807 (Sept. 11, 2026): &lt;a href="https://www.federalregister.gov/documents/2026/09/11/2026-18631/eliminating-the-discretionary-60-day-grace-period" rel="noopener noreferrer"&gt;https://www.federalregister.gov/documents/2026/09/11/2026-18631/eliminating-the-discretionary-60-day-grace-period&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Regulations.gov docket USCIS-2026-0364: &lt;a href="https://www.regulations.gov/docket/USCIS-2026-0364" rel="noopener noreferrer"&gt;https://www.regulations.gov/docket/USCIS-2026-0364&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;eCFR, 8 CFR 214.1 (see paragraph (l)): &lt;a href="https://www.ecfr.gov/current/title-8/chapter-I/subchapter-B/part-214/section-214.1" rel="noopener noreferrer"&gt;https://www.ecfr.gov/current/title-8/chapter-I/subchapter-B/part-214/section-214.1&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;When a client project ends, H-1B timing is one of the issues PIXEL RECRUITING LLC tracks for the engineers we place. PIXEL RECRUITING LLC is a direct staffing partner for Mastercard in O'Fallon, MO. Visit &lt;a href="https://pixelrecruiting.com" rel="noopener noreferrer"&gt;pixelrecruiting.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>immigration</category>
      <category>career</category>
      <category>h1b</category>
      <category>news</category>
    </item>
    <item>
      <title>A CSS Grid Column Set to 1fr Still Overflows? The Minimum Is Not Zero</title>
      <dc:creator>Pixel Recruiting LLC</dc:creator>
      <pubDate>Sun, 15 Nov 2026 05:49:05 +0000</pubDate>
      <link>https://dev.to/pixelrecruiting/a-css-grid-column-set-to-1fr-still-overflows-the-minimum-is-not-zero-2kg8</link>
      <guid>https://dev.to/pixelrecruiting/a-css-grid-column-set-to-1fr-still-overflows-the-minimum-is-not-zero-2kg8</guid>
      <description>&lt;p&gt;We built a simple two-column page. The side menu had a fixed width. The main column was &lt;code&gt;1fr&lt;/code&gt;, which we read as "take whatever width is left." Then we put a long, unwrapped line of code in the main column. The page grew a horizontal scrollbar. The main column was wider than the leftover space. The &lt;code&gt;1fr&lt;/code&gt; did not shrink.&lt;/p&gt;

&lt;p&gt;This is a CSS Grid issue. It is close in spirit to a flex item's automatic minimum, but the property that surprises people here is the track size itself.&lt;/p&gt;

&lt;h2&gt;
  
  
  The layout
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"page"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;nav&lt;/span&gt; &lt;span class="na"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"side"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Menu&lt;span class="nt"&gt;&amp;lt;/nav&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;main&lt;/span&gt; &lt;span class="na"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"main"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;pre&amp;gt;&lt;/span&gt;npm install some-long-package-name-and-then-another-one&lt;span class="nt"&gt;&amp;lt;/pre&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/main&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.page&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;grid&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;grid-template-columns&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;120px&lt;/span&gt; &lt;span class="mi"&gt;1fr&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;400px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.main&lt;/span&gt; &lt;span class="nt"&gt;pre&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;white-space&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;nowrap&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;The page is 400 pixels wide. The menu is 120 pixels. You would expect the main column to be the rest, about 280 pixels. You would also expect the long line to sit inside it, or to scroll inside it. That is not what happens.&lt;/p&gt;

&lt;h2&gt;
  
  
  What we measured
&lt;/h2&gt;

&lt;p&gt;We pasted this layout into Chrome and measured the boxes on November 13, 2026, in Chrome 156.&lt;/p&gt;

&lt;p&gt;The long line in this snippet measured about 430 pixels. The main column grew to that same width, about 430 pixels. The 400-pixel page then overflowed. The &lt;code&gt;1fr&lt;/code&gt; track did not stay in the leftover space.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why a bare &lt;code&gt;1fr&lt;/code&gt; has a content minimum
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;fr&lt;/code&gt; means a fraction of leftover space. MDN's page on &lt;code&gt;grid-template-columns&lt;/code&gt; adds a key detail. When &lt;code&gt;fr&lt;/code&gt; is used on its own, not inside &lt;code&gt;minmax()&lt;/code&gt;, it implies an automatic minimum. MDN writes this as &lt;code&gt;minmax(auto, &amp;lt;flex&amp;gt;)&lt;/code&gt;. So &lt;code&gt;1fr&lt;/code&gt; is &lt;code&gt;minmax(auto, 1fr)&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;1fr&lt;/code&gt; is only the maximum. The minimum is &lt;code&gt;auto&lt;/code&gt;. For a grid item, that automatic minimum is based on its content when the item is not a scroll container. The CSS Grid specification covers this in section 6.6. A single long line that cannot wrap sets a floor for the track: the track will not get narrower than that line.&lt;/p&gt;

&lt;p&gt;So the track will not go below that line's width, even when the line is wider than the leftover space. The page overflows.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two direct fixes
&lt;/h2&gt;

&lt;p&gt;The first fix is to set the minimum to zero in the track list:&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;.page&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;grid&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;grid-template-columns&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;120px&lt;/span&gt; &lt;span class="nf"&gt;minmax&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1fr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;400px&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;In the same Chrome test, the main column shrank to the leftover space: 280 pixels, after the 120-pixel menu. The long line no longer forced the column open.&lt;/p&gt;

&lt;p&gt;The second fix leaves &lt;code&gt;1fr&lt;/code&gt; as it is and puts &lt;code&gt;min-width: 0&lt;/code&gt; on the grid item in that column:&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;.main&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;min-width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&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 also gave a 280-pixel main column in our test.&lt;/p&gt;

&lt;p&gt;If you want the long line to scroll inside the main column, add &lt;code&gt;overflow: auto&lt;/code&gt; on &lt;code&gt;.main&lt;/code&gt; as well. In a third test, &lt;code&gt;overflow: hidden&lt;/code&gt; on &lt;code&gt;.main&lt;/code&gt; also let the column shrink to 280 pixels. It clipped the leftover content, so the page itself no longer overflowed. We prefer &lt;code&gt;minmax(0, 1fr)&lt;/code&gt; or &lt;code&gt;min-width: 0&lt;/code&gt;, and &lt;code&gt;overflow: auto&lt;/code&gt; when the content should scroll inside the column.&lt;/p&gt;

&lt;h2&gt;
  
  
  Equal columns have the same trap
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;grid-template-columns: 1fr 1fr&lt;/code&gt; looks like two equal halves. It is two tracks that each have a content minimum. In our 400-pixel page, we put the same long line in the left column and a short word in the right. The left column grew to the full width of the line. The right column was only 37 pixels wide. They were not equal.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;grid-template-columns: minmax(0, 1fr) minmax(0, 1fr)&lt;/code&gt; made both columns 200 pixels, which is half of the 400-pixel page.&lt;/p&gt;

&lt;p&gt;If you want equal, shrinking columns, write the zero minimum on each track.&lt;/p&gt;

&lt;h2&gt;
  
  
  A short checklist
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A bare &lt;code&gt;1fr&lt;/code&gt; is &lt;code&gt;minmax(auto, 1fr)&lt;/code&gt;. The &lt;code&gt;auto&lt;/code&gt; is a content minimum.&lt;/li&gt;
&lt;li&gt;Long unwrapped text, a wide table, or a large image can hold that track open.&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;minmax(0, 1fr)&lt;/code&gt; on the track, or &lt;code&gt;min-width: 0&lt;/code&gt; on the item.&lt;/li&gt;
&lt;li&gt;Do this for every &lt;code&gt;1fr&lt;/code&gt; track that should be allowed to shrink.&lt;/li&gt;
&lt;li&gt;If the content is still wider than the column, set &lt;code&gt;overflow&lt;/code&gt; on the item so the extra scrolls or clips inside it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Browser support is broad. On MDN, &lt;code&gt;grid-template-columns&lt;/code&gt; and &lt;code&gt;minmax()&lt;/code&gt; are marked Baseline widely available from October 2017.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;MDN, grid-template-columns: &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-columns" rel="noopener noreferrer"&gt;https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-columns&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;MDN, minmax(): &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/minmax" rel="noopener noreferrer"&gt;https://developer.mozilla.org/en-US/docs/Web/CSS/minmax&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;W3C CSS Grid Layout Module Level 1, section 6.6 (automatic minimum size) and section 7.2.4 (&lt;code&gt;fr&lt;/code&gt; unit): &lt;a href="https://www.w3.org/TR/css-grid-1/#min-size-auto" rel="noopener noreferrer"&gt;https://www.w3.org/TR/css-grid-1/#min-size-auto&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;PIXEL RECRUITING LLC looks for frontend and UI engineers who can explain why a grid track will not shrink, not only paste a fix. We are a direct staffing partner for Mastercard in O'Fallon, MO. You can see how we work at &lt;a href="https://pixelrecruiting.com" rel="noopener noreferrer"&gt;pixelrecruiting.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>css</category>
      <category>frontend</category>
      <category>grid</category>
      <category>layout</category>
    </item>
    <item>
      <title>The F-1 Fixed-Date Rule Is on Hold: What OPT and STEM OPT Workers Should Know</title>
      <dc:creator>Pixel Recruiting LLC</dc:creator>
      <pubDate>Sat, 14 Nov 2026 13:47:42 +0000</pubDate>
      <link>https://dev.to/pixelrecruiting/the-f-1-fixed-date-rule-is-on-hold-what-opt-and-stem-opt-workers-should-know-4op7</link>
      <guid>https://dev.to/pixelrecruiting/the-f-1-fixed-date-rule-is-on-hold-what-opt-and-stem-opt-workers-should-know-4op7</guid>
      <description>&lt;p&gt;A final DHS rule from July 2026 would change how long F-1 students may stay in the United States. If you are on OPT, you may have read about it and started planning for new forms and shorter deadlines. Then, one day before the rule's start date, a federal court put it on hold.&lt;/p&gt;

&lt;p&gt;This post sorts out what is on paper and what is actually in force. We wrote it in early November 2026. Court cases move, so check the latest before you act.&lt;/p&gt;

&lt;h2&gt;
  
  
  The short answer
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The rule would replace &lt;strong&gt;duration of status&lt;/strong&gt; with a &lt;strong&gt;fixed end date&lt;/strong&gt; for F-1 students.&lt;/li&gt;
&lt;li&gt;Its stated effective date was &lt;strong&gt;September 15, 2026&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;One day earlier, on &lt;strong&gt;September 14, 2026&lt;/strong&gt;, the federal district court in Massachusetts &lt;strong&gt;postponed&lt;/strong&gt; that date. It also barred DHS and ICE from taking further steps to put the rule in place, until the court orders otherwise or the case is decided.&lt;/li&gt;
&lt;li&gt;DHS has appealed. The case is still open.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Some terms first:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Duration of status (D/S)&lt;/strong&gt;: today, an F-1 student's I-94 usually shows "D/S" instead of a date. There is no set end date, as long as you keep to the F-1 rules.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;I-94&lt;/strong&gt;: the record of your arrival and how long you may stay.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Extension of stay (EOS)&lt;/strong&gt;: a request to USCIS for more time in your status. For F-1 students under the new rule, this is Form I-539.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;EAD&lt;/strong&gt;: the work card USCIS issues for OPT.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What the rule would do if it takes effect
&lt;/h2&gt;

&lt;p&gt;The final rule, printed at page 44976 of volume 91 of the Federal Register, makes many changes. These are the ones that touch people on OPT most:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;A date on the I-94.&lt;/strong&gt; An F-1 admission would match the program's length, capped at 4 years.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A shorter wind-down.&lt;/strong&gt; The time to leave the U.S. or move to another status after finishing studies or post-completion practical training would drop from 60 days to 30 days.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;An extension for post-completion OPT.&lt;/strong&gt; In DHS's words, people heading into post-completion OPT or STEM OPT would "most likely" have to get an EOS from USCIS, unless they travel abroad and come back in with an I-20 that shows the OPT recommendation. Students may file the EOS and the OPT work permit request together.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No start until both are approved.&lt;/strong&gt; DHS says that if your stay ends when your program ends, you can be in an authorized period while the EOS is pending, but you may not start new OPT work until both the EOS and the EAD are approved. Transition relief is an exception, as is time left on pre-completion OPT.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;STEM OPT keeps one cushion.&lt;/strong&gt; DHS says the current 180-day rule stays as it is. That is the rule that lets a person with a timely, pending STEM OPT application keep working for as long as 180 days past the old EAD's end date.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  The transition plan written into the rule
&lt;/h2&gt;

&lt;p&gt;The rule also has a transition section for people who were in D/S and keeping their status on September 15, 2026. In short:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;They could stay until the later of their EAD end date or their I-20 program end date, with an outer limit of November 14, 2030 for F students. The cap is the 4-year mark after September 15, 2026, with 60 more days added.&lt;/li&gt;
&lt;li&gt;An on-time OPT or STEM OPT work permit request (Form I-765), sent &lt;strong&gt;no later than March 18, 2027&lt;/strong&gt;, would not need a separate I-539.&lt;/li&gt;
&lt;li&gt;Someone who left the U.S. before filing for OPT or STEM OPT and came back with a fixed admission date would have to file two forms: an I-765 plus an I-539.&lt;/li&gt;
&lt;li&gt;DHS kept the option to push the March 18, 2027 date out in 6-month steps with a Federal Register notice.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All of this is only on paper while the court order stands.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the court did
&lt;/h2&gt;

&lt;p&gt;The case number is 1:26-cv-13799-FDS in federal district court in Massachusetts. The lead plaintiff is a higher-education group called the Presidents' Alliance, and DHS is the lead defendant.&lt;/p&gt;

&lt;p&gt;The court's order of September 14, 2026:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;postponed the rule's effective date under section 705 of the Administrative Procedure Act, pending further order or a final decision on the merits, and&lt;/li&gt;
&lt;li&gt;issued a preliminary injunction (a court block) that stops DHS and ICE from doing anything more to carry out the rule.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The same order did not grant everything the challengers asked for. It denied, for now, their request to vacate (cancel) the rule outright.&lt;/p&gt;

&lt;p&gt;A later DHS court filing, dated October 9, 2026, states that DHS appealed to the First Circuit on September 30, 2026.&lt;/p&gt;

&lt;p&gt;Both sides have since asked the judge to decide the case on the written record (&lt;a href="https://storage.courtlistener.com/recap/gov.uscourts.mad.305059/gov.uscourts.mad.305059.66.0.pdf" rel="noopener noreferrer"&gt;DHS motion&lt;/a&gt;, &lt;a href="https://storage.courtlistener.com/recap/gov.uscourts.mad.305059/gov.uscourts.mad.305059.68.0.pdf" rel="noopener noreferrer"&gt;challengers' motion&lt;/a&gt;).&lt;/p&gt;

&lt;h2&gt;
  
  
  One trap: the online regulations
&lt;/h2&gt;

&lt;p&gt;We downloaded sections 214.1 and 214.2 of Title 8 from the eCFR, the government's online version of the regulations, for November 2, 2026. That version already shows the new wording, including the 30-day departure period and the March 18, 2027 transition date. If you search the eCFR, you may land on rule text that the court has paused. Read it together with the court order, and ask your DSO which version your school is following. Some agency pages, like Study in the States' rule summary, also still describe the rule as if it were in force.&lt;/p&gt;

&lt;h2&gt;
  
  
  What we would keep doing right now
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Keep following the rules in force before the rule.&lt;/strong&gt; USCIS says that, until the court order is lifted, it 'will proceed under the previous regulatory provisions.' Today that means the 60-day period after OPT ends.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use the normal STEM OPT timing.&lt;/strong&gt; USCIS gives a 90-day window that closes when the OPT card you have now expires. Your filing also has to reach USCIS inside 60 days from the DSO's SEVIS recommendation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ask before you travel.&lt;/strong&gt; If the rule later takes effect, re-entry is one of the points where the transition rules change. Talk to your DSO before booking a trip.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Watch for an update.&lt;/strong&gt; The court could rule on the merits, or the appeal could change things. Your school's international office and the Federal Register are good places to watch.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Please read this part
&lt;/h2&gt;

&lt;p&gt;PIXEL RECRUITING LLC is sharing what public court and federal records say, in simpler words. This is not legal advice, and it may be out of date by the time you read it. An immigration attorney or your DSO can tell you how the current state of the case affects you.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Federal Register document 2026-14439 (published July 17, 2026): &lt;a href="https://www.federalregister.gov/documents/2026/07/17/2026-14439/establishing-a-fixed-time-period-of-admission-and-an-extension-of-stay-procedure-for-nonimmigrant" rel="noopener noreferrer"&gt;https://www.federalregister.gov/documents/2026/07/17/2026-14439/establishing-a-fixed-time-period-of-admission-and-an-extension-of-stay-procedure-for-nonimmigrant&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Court order postponing the rule, D. Mass. No. 1:26-cv-13799-FDS, ECF No. 51 (Sept. 14, 2026): &lt;a href="https://storage.courtlistener.com/recap/gov.uscourts.mad.305059/gov.uscourts.mad.305059.51.0_1.pdf" rel="noopener noreferrer"&gt;https://storage.courtlistener.com/recap/gov.uscourts.mad.305059/gov.uscourts.mad.305059.51.0_1.pdf&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;DHS filing describing the appeal, ECF No. 59 (Oct. 9, 2026): &lt;a href="https://storage.courtlistener.com/recap/gov.uscourts.mad.305059/gov.uscourts.mad.305059.59.0.pdf" rel="noopener noreferrer"&gt;https://storage.courtlistener.com/recap/gov.uscourts.mad.305059/gov.uscourts.mad.305059.59.0.pdf&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;eCFR, 8 CFR 214.1: &lt;a href="https://www.ecfr.gov/current/title-8/chapter-I/subchapter-B/part-214/section-214.1" rel="noopener noreferrer"&gt;https://www.ecfr.gov/current/title-8/chapter-I/subchapter-B/part-214/section-214.1&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;USCIS, STEM OPT extension information: &lt;a href="https://www.uscis.gov/working-in-the-united-states/students-and-exchange-visitors/optional-practical-training-extension-for-stem-students-stem-opt" rel="noopener noreferrer"&gt;https://www.uscis.gov/working-in-the-united-states/students-and-exchange-visitors/optional-practical-training-extension-for-stem-students-stem-opt&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;USCIS, Form I-539 page (alert on the court order): &lt;a href="https://www.uscis.gov/i-539" rel="noopener noreferrer"&gt;https://www.uscis.gov/i-539&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;At PIXEL RECRUITING LLC we match frontend and UI developers with employers, and some of those developers hold F-1 work permission through OPT or STEM OPT. We keep an eye on court cases like this one so they do not surprise the candidates we work with. We are a direct staffing partner for Mastercard in O'Fallon, MO. Visit &lt;a href="https://pixelrecruiting.com" rel="noopener noreferrer"&gt;pixelrecruiting.com&lt;/a&gt; to work with us.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>immigration</category>
      <category>career</category>
      <category>opt</category>
      <category>news</category>
    </item>
    <item>
      <title>text-overflow: ellipsis Does Nothing in a Flex Row? Look at min-width</title>
      <dc:creator>Pixel Recruiting LLC</dc:creator>
      <pubDate>Sat, 14 Nov 2026 06:09:41 +0000</pubDate>
      <link>https://dev.to/pixelrecruiting/text-overflow-ellipsis-does-nothing-in-a-flex-row-look-at-min-width-3mn0</link>
      <guid>https://dev.to/pixelrecruiting/text-overflow-ellipsis-does-nothing-in-a-flex-row-look-at-min-width-3mn0</guid>
      <description>&lt;p&gt;This layout bug shows up in a lot of UIs. A row has an icon, a long file name and a button. You want the name to end with "..." when space runs out. You add the usual three lines. Nothing happens. The name keeps its full length and shoves the button past the edge of the card.&lt;/p&gt;

&lt;h2&gt;
  
  
  The setup
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"file-row"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"icon"&lt;/span&gt; &lt;span class="na"&gt;src&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"pdf.svg"&lt;/span&gt; &lt;span class="na"&gt;alt&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;""&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;span&lt;/span&gt; &lt;span class="na"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"name"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;quarterly-report-final-version-2-really-final.pdf&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;button&amp;gt;&lt;/span&gt;Share&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.file-row&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;align-items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;gap&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;8px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;280px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.name&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;overflow&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;hidden&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;white-space&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;nowrap&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;text-overflow&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;ellipsis&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;Those three lines on &lt;code&gt;.name&lt;/code&gt; are right. MDN points out that &lt;code&gt;text-overflow&lt;/code&gt; cannot cause an overflow on its own. You pair it with &lt;code&gt;overflow&lt;/code&gt; and &lt;code&gt;white-space&lt;/code&gt;, and MDN's own example is &lt;code&gt;overflow: hidden&lt;/code&gt; plus &lt;code&gt;white-space: nowrap&lt;/code&gt;. Both are here.&lt;/p&gt;

&lt;p&gt;This first version works, because &lt;code&gt;.name&lt;/code&gt; is itself the flex item and &lt;code&gt;overflow: hidden&lt;/code&gt; gives it a zero minimum.&lt;/p&gt;

&lt;p&gt;So why no dots? In many real layouts, the text is not the flex item. It sits one level deeper.&lt;/p&gt;

&lt;h2&gt;
  
  
  The version that breaks
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"file-row"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"icon"&lt;/span&gt; &lt;span class="na"&gt;src&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"pdf.svg"&lt;/span&gt; &lt;span class="na"&gt;alt&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;""&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"meta"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;span&lt;/span&gt; &lt;span class="na"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"name"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;quarterly-report-final-version-2-really-final.pdf&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;span&lt;/span&gt; &lt;span class="na"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"size"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;2.4 MB&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;button&amp;gt;&lt;/span&gt;Share&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.meta&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;flex-direction&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;column&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.name&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;overflow&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;hidden&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;white-space&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;nowrap&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;text-overflow&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;ellipsis&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;Now &lt;code&gt;.meta&lt;/code&gt; is the flex item in the row. It has no &lt;code&gt;overflow&lt;/code&gt; of its own. That one detail is the whole bug.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why it happens: the automatic minimum size
&lt;/h2&gt;

&lt;p&gt;Every flex item starts with &lt;code&gt;min-width: auto&lt;/code&gt;. For flex items, &lt;code&gt;auto&lt;/code&gt; does not mean zero.&lt;/p&gt;

&lt;p&gt;Section 4.5 of the CSS Flexbox spec covers this. A flex item's automatic minimum width comes from its content, unless the item is a scroll container. MDN's &lt;code&gt;min-width&lt;/code&gt; page says the same thing in shorter words: for flex items, &lt;code&gt;auto&lt;/code&gt; resolves to a content-based size, and a scroll container gets a minimum of 0.&lt;/p&gt;

&lt;p&gt;What does "based on content" mean for one long line of text that cannot wrap? The smallest the item may get is the full width of that line. So:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The row is 280px wide.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;.meta&lt;/code&gt; wants to shrink to fit next to the icon and the button.&lt;/li&gt;
&lt;li&gt;Its minimum width is the full width of the file name.&lt;/li&gt;
&lt;li&gt;Shrinking stops there. The row overflows.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;.name&lt;/code&gt; is as wide as its text, so it never needs to cut anything. No dots appear.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code&gt;flex-shrink&lt;/code&gt; is still on, by the way. It just cannot shrink an item below its minimum size.&lt;/p&gt;

&lt;h2&gt;
  
  
  The fix: let the flex item get small
&lt;/h2&gt;

&lt;p&gt;Give the flex item that holds the text a zero minimum:&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;.meta&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;flex-direction&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;column&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;min-width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="cm"&gt;/* the fix */&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now &lt;code&gt;.meta&lt;/code&gt; can shrink below its content width. &lt;code&gt;.name&lt;/code&gt; inside it gets a real, narrow width, its text overflows, and the ellipsis shows up.&lt;/p&gt;

&lt;p&gt;Another way is &lt;code&gt;overflow: hidden&lt;/code&gt; on &lt;code&gt;.meta&lt;/code&gt;. That turns it into a scroll container, and per the spec and MDN, a scroll container's automatic minimum is 0. We prefer &lt;code&gt;min-width: 0&lt;/code&gt; for this case. It states the intent directly, and it does not hide parts of &lt;code&gt;.meta&lt;/code&gt;'s children that paint past its edges, such as a child's focus ring.&lt;/p&gt;

&lt;p&gt;One note from reading the docs: MDN says &lt;code&gt;overflow: clip&lt;/code&gt; does not create a scroll container, while &lt;code&gt;hidden&lt;/code&gt; does. So we would not expect &lt;code&gt;overflow: clip&lt;/code&gt; on &lt;code&gt;.meta&lt;/code&gt; to reset the minimum. Use &lt;code&gt;min-width: 0&lt;/code&gt; or &lt;code&gt;overflow: hidden&lt;/code&gt; here.&lt;/p&gt;

&lt;h2&gt;
  
  
  Nested rows need it at every level
&lt;/h2&gt;

&lt;p&gt;If the text sits inside several nested flex containers, each flex item between the row and the text can hold the line open. Put &lt;code&gt;min-width: 0&lt;/code&gt; on each flex item on that path, not only the one nearest the text.&lt;/p&gt;

&lt;h2&gt;
  
  
  A quick checklist
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Text has &lt;code&gt;overflow: hidden&lt;/code&gt;, &lt;code&gt;white-space: nowrap&lt;/code&gt; and &lt;code&gt;text-overflow: ellipsis&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The text element has a width limit (for example it is a block, or a flex item that can shrink).&lt;/li&gt;
&lt;li&gt;Every flex item between the row and the text has &lt;code&gt;min-width: 0&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;If the dots still do not show, open DevTools and look for the first ancestor whose width equals the full text width. That one is missing the fix.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These properties are well supported. MDN lists &lt;code&gt;min-width&lt;/code&gt;, &lt;code&gt;overflow&lt;/code&gt; and &lt;code&gt;text-overflow&lt;/code&gt; as Baseline widely available since July 2015, and &lt;code&gt;flex-shrink&lt;/code&gt; since September 2015.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;W3C Flexbox spec (css-flexbox-1), section 4.5: &lt;a href="https://www.w3.org/TR/css-flexbox-1/#min-size-auto" rel="noopener noreferrer"&gt;https://www.w3.org/TR/css-flexbox-1/#min-size-auto&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;MDN, min-width: &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/min-width" rel="noopener noreferrer"&gt;https://developer.mozilla.org/en-US/docs/Web/CSS/min-width&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;MDN, text-overflow: &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/text-overflow" rel="noopener noreferrer"&gt;https://developer.mozilla.org/en-US/docs/Web/CSS/text-overflow&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;MDN, overflow: &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/overflow" rel="noopener noreferrer"&gt;https://developer.mozilla.org/en-US/docs/Web/CSS/overflow&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;MDN, flex-shrink: &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/flex-shrink" rel="noopener noreferrer"&gt;https://developer.mozilla.org/en-US/docs/Web/CSS/flex-shrink&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;Engineers who can explain why &lt;code&gt;min-width: 0&lt;/code&gt; works, not just paste it, are the people PIXEL RECRUITING LLC likes to introduce to product teams that need frontend and UI help. We are a direct staffing partner for Mastercard in O'Fallon, MO, and you can learn more at &lt;a href="https://pixelrecruiting.com" rel="noopener noreferrer"&gt;pixelrecruiting.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>css</category>
      <category>frontend</category>
      <category>webdev</category>
      <category>html</category>
    </item>
    <item>
      <title>On H-1B and Working Inside a Client's Team? Whose Job Requirements USCIS Reads</title>
      <dc:creator>Pixel Recruiting LLC</dc:creator>
      <pubDate>Thu, 12 Nov 2026 11:31:47 +0000</pubDate>
      <link>https://dev.to/pixelrecruiting/on-h-1b-and-working-inside-a-clients-team-whose-job-requirements-uscis-reads-4bjl</link>
      <guid>https://dev.to/pixelrecruiting/on-h-1b-and-working-inside-a-clients-team-whose-job-requirements-uscis-reads-4bjl</guid>
      <description>&lt;p&gt;A lot of engineers on H-1B are paid by one company but sit with another. The paying company is the staffing firm or consultancy. The other company is the client, where the daily work happens. Since January 17, 2025, the H-1B regulations say something specific about this setup. It changes which company's hiring standards USCIS looks at.&lt;/p&gt;

&lt;h2&gt;
  
  
  The short answer
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;If you fill a &lt;strong&gt;position inside the client's own organization&lt;/strong&gt;, USCIS looks mainly at the &lt;strong&gt;client's&lt;/strong&gt; degree requirements for that role.&lt;/li&gt;
&lt;li&gt;If you &lt;strong&gt;deliver services&lt;/strong&gt; to the client as part of your employer's team, such as one software project, USCIS generally looks at &lt;strong&gt;your employer's&lt;/strong&gt; requirements.&lt;/li&gt;
&lt;li&gt;USCIS can check facts at the client's site. If the client or your employer will not cooperate, petitions for people working at that site can be denied or revoked.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Some terms first:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Petitioner&lt;/strong&gt;: the company that files Form I-129 with USCIS to ask for H-1B status for you.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Beneficiary&lt;/strong&gt;: you, the worker named in the petition.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Third party&lt;/strong&gt;: the client or end client where you are placed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Specialty occupation&lt;/strong&gt;: a job that normally needs at least a U.S. bachelor's degree, or the same level of learning, in a specific field that is directly related to the work.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Where this rule comes from
&lt;/h2&gt;

&lt;p&gt;On December 18, 2024, DHS published what most people call the H-1B "modernization" final rule. It took effect January 17, 2025. It added a "third party requirements" paragraph to 8 CFR 214.2(h). That paragraph is in the current eCFR.&lt;/p&gt;

&lt;p&gt;In short, the paragraph says this. Picture an H-1B worker who is "staffed" at a client. That means the worker fills a slot in the client's organizational hierarchy, not just providing services to the client. In that case the real day-to-day work has to count as a specialty occupation. When USCIS judges that, it is the client's requirements, not the petitioner's, that matter most.&lt;/p&gt;

&lt;p&gt;The same rule also lets the client's normal degree requirement serve as one of the ways to show a role is a specialty occupation, when the worker is staffed there.&lt;/p&gt;

&lt;h2&gt;
  
  
  Staffed or providing services? Two examples from DHS
&lt;/h2&gt;

&lt;p&gt;The rule's preamble (the long explanation before the rule text) gives examples. In our words:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Providing services.&lt;/strong&gt; An IT consulting firm builds a custom app for a real estate company. A real estate company does not normally employ software developers. So USCIS would look at the consulting firm's own degree standards for the developer role.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Staffed.&lt;/strong&gt; A client already has people in the same role and brings in contractors to add to its regular staff. Here, the client knows the duties and what they require. The client's requirements would control.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;DHS also says a developer working on a discrete project as part of the petitioner's own team would generally not be "staffed" to the client.&lt;/p&gt;

&lt;h2&gt;
  
  
  What evidence USCIS tends to look at
&lt;/h2&gt;

&lt;p&gt;According to the preamble, USCIS considers the normal business of both companies, the services each one provides, the work you will do, and how each company is organized. Evidence can include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;master services agreements and statements of work,&lt;/li&gt;
&lt;li&gt;letters from the end client,&lt;/li&gt;
&lt;li&gt;organizational charts,&lt;/li&gt;
&lt;li&gt;staffing and company descriptions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;DHS says this generally does &lt;strong&gt;not&lt;/strong&gt; mean looking at who pays you, your benefits, your equipment, your schedule or your work location.&lt;/p&gt;

&lt;h2&gt;
  
  
  A real job, but not every task mapped out
&lt;/h2&gt;

&lt;p&gt;The regulations also require a bona fide (real) specialty occupation position for you from the first day of the period requested in the petition. The petitioner does &lt;strong&gt;not&lt;/strong&gt; have to list your day-to-day assignments for the whole period requested. That helps consulting work, where projects change.&lt;/p&gt;

&lt;h2&gt;
  
  
  Checks at the client's site
&lt;/h2&gt;

&lt;p&gt;USCIS can also check facts at the client's site, including by visiting and interviewing people there. If the employer or the client will not cooperate, USCIS may deny or revoke petitions for workers at that site.&lt;/p&gt;

&lt;h2&gt;
  
  
  What we suggest checking if you are placed at a client
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Know which setup you are in.&lt;/strong&gt; Ask your employer whether your role was described as staffed to the client or as services delivered by your employer's team.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Compare duties.&lt;/strong&gt; Read the job duties in your petition. Do they match what you actually do at the client each week?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Know your contacts.&lt;/strong&gt; Have the names of your manager at your employer and your lead at the client.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Plan for a move.&lt;/strong&gt; If you will be sent to a client in a different area that needs a new labor condition application (LCA), the rule treats that as a material change. Your employer must get a fresh or amended petition on file before the move. The current rule also says you may not work under the changed terms until USCIS approves that petition and it takes effect. H-1B portability is the one exception the rule names.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Before you act on this
&lt;/h2&gt;

&lt;p&gt;PIXEL RECRUITING LLC wrote this from public DHS documents to make dense rules plainer. Nobody here practices law, and none of this is legal advice. Every placement has its own contracts and facts. An immigration attorney who sees your papers can tell you how the rules apply to you.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Federal Register document 2024-29354, the H-1B modernization rule (Dec. 18, 2024; in effect from Jan. 17, 2025): &lt;a href="https://www.federalregister.gov/documents/2024/12/18/2024-29354/modernizing-h-1b-requirements-providing-flexibility-in-the-f-1-program-and-program-improvements" rel="noopener noreferrer"&gt;https://www.federalregister.gov/documents/2024/12/18/2024-29354/modernizing-h-1b-requirements-providing-flexibility-in-the-f-1-program-and-program-improvements&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;eCFR, 8 CFR 214.2 (see paragraph (h)): &lt;a href="https://www.ecfr.gov/current/title-8/chapter-I/subchapter-B/part-214/section-214.2" rel="noopener noreferrer"&gt;https://www.ecfr.gov/current/title-8/chapter-I/subchapter-B/part-214/section-214.2&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;USCIS overview page for the H-1B program: &lt;a href="https://www.uscis.gov/working-in-the-united-states/h-1b-specialty-occupations" rel="noopener noreferrer"&gt;https://www.uscis.gov/working-in-the-united-states/h-1b-specialty-occupations&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;Placing frontend and UI talent on client projects is core to PIXEL RECRUITING LLC, so client-site questions like these are part of our work. PIXEL RECRUITING LLC is a direct staffing partner for Mastercard in O'Fallon, MO. See open roles and how we work at &lt;a href="https://pixelrecruiting.com" rel="noopener noreferrer"&gt;pixelrecruiting.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>immigration</category>
      <category>career</category>
      <category>h1b</category>
      <category>staffing</category>
    </item>
    <item>
      <title>A $70,000 OPT Fee Has Been Proposed. What It Could Mean for a Future STEM OPT Request</title>
      <dc:creator>Pixel Recruiting LLC</dc:creator>
      <pubDate>Sun, 08 Nov 2026 16:20:01 +0000</pubDate>
      <link>https://dev.to/pixelrecruiting/a-70000-opt-fee-has-been-proposed-what-it-could-mean-for-a-future-stem-opt-request-4kf7</link>
      <guid>https://dev.to/pixelrecruiting/a-70000-opt-fee-has-been-proposed-what-it-could-mean-for-a-future-stem-opt-request-4kf7</guid>
      <description>&lt;p&gt;Are you on OPT right now, and hoping to ask for the STEM OPT extension later? Then one federal proposal from October 2026 is worth ten minutes of reading.&lt;/p&gt;

&lt;h2&gt;
  
  
  The short answer
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;DHS has &lt;strong&gt;proposed&lt;/strong&gt; two new OPT fees: $70,000 the first time a student gets OPT, and $30,000 for each later OPT request. For a student whose school already paid the $70,000, the STEM OPT extension counts as a later request.&lt;/li&gt;
&lt;li&gt;The school would pay the fee, not USCIS and not (directly) you. But DHS openly says schools could shift the cost to students or employers.&lt;/li&gt;
&lt;li&gt;This is &lt;strong&gt;not a final rule&lt;/strong&gt;. It changes nothing today.&lt;/li&gt;
&lt;li&gt;Public comments close on &lt;strong&gt;November 9, 2026&lt;/strong&gt;, at 11:59 p.m. Eastern time.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Some terms we use below:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;OPT&lt;/strong&gt; (Optional Practical Training): F-1 work time tied to what you studied.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;STEM OPT&lt;/strong&gt; adds 24 more months of OPT for certain science, tech, engineering and math degrees.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DSO&lt;/strong&gt; stands for designated school official, your school's F-1 contact who signs off on OPT.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SEVIS&lt;/strong&gt; is the federal system where your F-1 file lives.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;EAD&lt;/strong&gt; is the plastic work card USCIS mails out (employment authorization document).&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What the proposal says
&lt;/h2&gt;

&lt;p&gt;On October 8, 2026, ICE (Immigration and Customs Enforcement), which sits inside DHS, released a proposal in the Federal Register under the title "Optional Practical Training Fees." Here is what it would do, in plain words:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Two amounts.&lt;/strong&gt; $70,000 for a student's first OPT of any type. $30,000 for any OPT after that. The notice gives examples of a later OPT: a second pre-completion period, post-completion OPT, or the STEM extension.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The school pays before the DSO acts.&lt;/strong&gt; The DSO could not enter an OPT recommendation in SEVIS until the school paid.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;USCIS would wait for payment.&lt;/strong&gt; USCIS would not grant OPT work permission unless the fee had been paid.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A new I-20.&lt;/strong&gt; The DSO would give the student an I-20 that shows the recommendation and the fee payment details. The student then files Form I-765 with USCIS.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Not tied to a job.&lt;/strong&gt; The fee is linked to the school's recommendation. A change of employer would not trigger it.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;On the cost question, the notice says schools may pass the financial burden to F-1 students, to all students, or to employers. The proposal itself does not decide who ends up paying.&lt;/p&gt;

&lt;h2&gt;
  
  
  Refunds under the plan
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;If the student has &lt;strong&gt;not yet received&lt;/strong&gt; the EAD, the school could ask for a refund. SEVP, the program that certifies F-1 schools, would decide. Its answer would be final, with no appeal.&lt;/li&gt;
&lt;li&gt;Once the student &lt;strong&gt;has received&lt;/strong&gt; the EAD, the fee would not be refunded at all.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Timing: who would and would not be charged
&lt;/h2&gt;

&lt;p&gt;DHS proposes that a final rule would take effect 60 days after it is published. The fee would apply to DSO recommendations dated on or after that day.&lt;/p&gt;

&lt;p&gt;The notice says a school would &lt;strong&gt;not&lt;/strong&gt; pay the fee for a student who, before that date:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;is already doing approved OPT,&lt;/li&gt;
&lt;li&gt;was already approved for OPT, or&lt;/li&gt;
&lt;li&gt;already had a DSO recommendation for OPT.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here is the part that matters for future STEM OPT. The same notice says that if such a student makes a &lt;strong&gt;new&lt;/strong&gt; OPT request on or after the effective date, the fee rules would apply to that new request. So a person on post-completion OPT today, whose STEM recommendation comes after a final rule takes effect, would be inside the new fee rules.&lt;/p&gt;

&lt;p&gt;One point to watch: the $30,000 amount is written only for students whose school already paid the $70,000 fee. The proposed rule text charges $70,000 for any OPT recommendation dated on or after the start date, unless that $70,000 was paid before. DHS's own cost estimate also assumes STEM OPT students would pay $70,000 in the first year. So someone whose first OPT came before the rule could face the $70,000 amount for a later STEM OPT request. A final rule could say this differently. Ask your DSO.&lt;/p&gt;

&lt;p&gt;DHS also asked for public views on another idea: charging the $70,000 amount again when a student moves to a higher degree level, for example from a bachelor's OPT to a master's OPT.&lt;/p&gt;

&lt;h2&gt;
  
  
  What we would do this week
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Read the notice yourself.&lt;/strong&gt; The Federal Register link is below. The summary and the "Public Participation" section are short.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Know your STEM OPT window.&lt;/strong&gt; Per USCIS, the STEM OPT Form I-765 can go in during the 90 days before the OPT card you hold now runs out. There is a second clock too: USCIS must get the form within 60 days from the day your school's DSO records the STEM recommendation in SEVIS. Talk to your DSO about where your dates fall.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tell your manager or HR.&lt;/strong&gt; An employer can comment too, and DHS named employers as one group that might end up paying.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Comment if you want to.&lt;/strong&gt; Students, schools and employers can all send one.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How to send a comment
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Go to regulations.gov and search for docket &lt;strong&gt;ICEB-2026-0100&lt;/strong&gt;. Include that docket number in what you send.&lt;/li&gt;
&lt;li&gt;Online only. DHS says emails and letters sent to the department will not be counted as comments.&lt;/li&gt;
&lt;li&gt;Comments must be in English or include an English translation.&lt;/li&gt;
&lt;li&gt;Comments become public, with any personal details you type in. Leave out private information.&lt;/li&gt;
&lt;li&gt;DHS says the comments that help it most name the exact section they are about and back the point with facts.&lt;/li&gt;
&lt;li&gt;A separate, later deadline of December 7, 2026 covers only the paperwork part of the proposal (the "information collection" under the Paperwork Reduction Act).&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  A note from us
&lt;/h2&gt;

&lt;p&gt;PIXEL RECRUITING LLC is a staffing company, not a law firm. Treat this post as a plain-language reading of a public notice. It is not legal advice. For dates that are yours alone, a DSO or a licensed immigration lawyer is the better place to ask.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Federal Register document 2026-20660, the OPT fee proposal, 91 FR 64566 (Oct. 8, 2026): &lt;a href="https://www.federalregister.gov/documents/2026/10/08/2026-20660/optional-practical-training-fees" rel="noopener noreferrer"&gt;https://www.federalregister.gov/documents/2026/10/08/2026-20660/optional-practical-training-fees&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Regulations.gov docket ICEB-2026-0100: &lt;a href="https://www.regulations.gov/docket/ICEB-2026-0100" rel="noopener noreferrer"&gt;https://www.regulations.gov/docket/ICEB-2026-0100&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;USCIS page on the STEM OPT extension: &lt;a href="https://www.uscis.gov/working-in-the-united-states/students-and-exchange-visitors/optional-practical-training-extension-for-stem-students-stem-opt" rel="noopener noreferrer"&gt;https://www.uscis.gov/working-in-the-united-states/students-and-exchange-visitors/optional-practical-training-extension-for-stem-students-stem-opt&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;PIXEL RECRUITING LLC finds frontend and UI engineers for client teams and is a direct staffing partner for Mastercard in O'Fallon, MO. OPT and STEM OPT rules shape the job plans of many engineers we place, so we follow fee and rule changes like this one closely. Reach us at &lt;a href="https://pixelrecruiting.com" rel="noopener noreferrer"&gt;pixelrecruiting.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>immigration</category>
      <category>career</category>
      <category>news</category>
      <category>opt</category>
    </item>
    <item>
      <title>A Dropdown With z-index: 9999 That Still Hides Behind the Page</title>
      <dc:creator>Pixel Recruiting LLC</dc:creator>
      <pubDate>Fri, 06 Nov 2026 13:59:32 +0000</pubDate>
      <link>https://dev.to/pixelrecruiting/a-dropdown-with-z-index-9999-that-still-hides-behind-the-page-18ma</link>
      <guid>https://dev.to/pixelrecruiting/a-dropdown-with-z-index-9999-that-still-hides-behind-the-page-18ma</guid>
      <description>&lt;p&gt;Here is a bug that many front-end teams run into sooner or later.&lt;/p&gt;

&lt;p&gt;You click a menu in the header. It opens, but only its top edge shows. The rest is hidden behind the hero banner below the header.&lt;/p&gt;

&lt;p&gt;So you do what everyone does. You give the dropdown &lt;code&gt;z-index: 9999&lt;/code&gt;. Nothing changes. You try &lt;code&gt;99999&lt;/code&gt;. Still nothing.&lt;/p&gt;

&lt;p&gt;The number was never the problem. The problem is &lt;strong&gt;where&lt;/strong&gt; the number lives.&lt;/p&gt;

&lt;h2&gt;
  
  
  Think of z-index as a version number
&lt;/h2&gt;

&lt;p&gt;MDN has a helpful way to picture this:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;To figure out the rendering order of stacked elements along the z-axis, think of each index value as a "version number" of sorts, where child elements represent minor version numbers underneath their parent's major version number.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Here is what that means in practice.&lt;/p&gt;

&lt;p&gt;Say the header is version 0 and the hero banner is version 1. The dropdown sits inside the header. So its full number is not 9999. It is 0.9999.&lt;/p&gt;

&lt;p&gt;And 0.9999 is still smaller than 1. The hero wins.&lt;/p&gt;

&lt;p&gt;The box that holds those "minor" numbers is called a &lt;strong&gt;stacking context&lt;/strong&gt;. MDN says:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Each stacking context is self-contained. After an element's contents are stacked, the entire element is considered as a single unit in the stacking order of its parent stacking context."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In short: a child can never climb above its stacking context. It can only move up or down inside it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bug 1: The sticky header
&lt;/h2&gt;

&lt;p&gt;Here is that page, cut down to the parts that matter.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;header&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"site-header"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;nav&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"nav-item"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      Products
      &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"dropdown"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;...&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/nav&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/header&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;section&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"hero"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;...&lt;span class="nt"&gt;&amp;lt;/section&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.site-header&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;white&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;sticky&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;top&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.nav-item&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;relative&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.dropdown&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;absolute&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;top&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;left&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;z-index&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;9999&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.hero&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;relative&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;z-index&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c"&gt;/* added earlier for a background effect */&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two things are going on.&lt;/p&gt;

&lt;p&gt;First, &lt;code&gt;position: sticky&lt;/code&gt; makes the header a stacking context on its own. MDN's list of triggers includes "Element with a position value fixed or sticky." So the dropdown's 9999 only counts inside the header.&lt;/p&gt;

&lt;p&gt;Second, the header itself has no &lt;code&gt;z-index&lt;/code&gt;. In the parent's stack, it sits at the same level as &lt;code&gt;z-index: 0&lt;/code&gt;. The hero has &lt;code&gt;z-index: 1&lt;/code&gt;. So the whole header, dropdown and all, paints under the hero.&lt;/p&gt;

&lt;p&gt;We checked this in Chrome 156 with &lt;code&gt;document.elementFromPoint()&lt;/code&gt;. A point inside the lower part of the dropdown returned the hero, not the dropdown.&lt;/p&gt;

&lt;h3&gt;
  
  
  The fix
&lt;/h3&gt;

&lt;p&gt;Raise the header, not the dropdown.&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;.site-header&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;white&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;sticky&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;top&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;z-index&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c"&gt;/* the fix */&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now the header is version 10 and the hero is version 1. The dropdown comes along with its parent. The same &lt;code&gt;elementFromPoint()&lt;/code&gt; check now returned the dropdown.&lt;/p&gt;

&lt;p&gt;The dropdown can go back to a small number too. &lt;code&gt;z-index: 1&lt;/code&gt; is plenty inside the header.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bug 2: The fade-in that never ends
&lt;/h2&gt;

&lt;p&gt;This one is sneakier, because the page looks the same before and after the bug.&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;.panel&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;animation&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;fade-in&lt;/span&gt; &lt;span class="m"&gt;0.3s&lt;/span&gt; &lt;span class="nb"&gt;forwards&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;@keyframes&lt;/span&gt; &lt;span class="n"&gt;fade-in&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nt"&gt;from&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;opacity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nt"&gt;to&lt;/span&gt;   &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;opacity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&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;The panel holds a menu with &lt;code&gt;position: absolute&lt;/code&gt; and &lt;code&gt;z-index: 1&lt;/code&gt;. Below the panel is a &lt;code&gt;position: relative&lt;/code&gt; box with no &lt;code&gt;z-index&lt;/code&gt;. The menu opens and hides behind that box.&lt;/p&gt;

&lt;p&gt;Why? &lt;code&gt;opacity&lt;/code&gt; below 1 makes a stacking context. That part is well known. But the animation ends at &lt;code&gt;opacity: 1&lt;/code&gt;, so it should be fine, right?&lt;/p&gt;

&lt;p&gt;Not quite. MDN's list also includes an "Element that has had stacking context-creating properties (such as opacity) animated using @keyframes, with animation-fill-mode set to forwards."&lt;/p&gt;

&lt;p&gt;So &lt;code&gt;forwards&lt;/code&gt; keeps the stacking context alive after the animation ends. The panel stays a closed box, and the positioned box after it paints on top.&lt;/p&gt;

&lt;h3&gt;
  
  
  The fix
&lt;/h3&gt;

&lt;p&gt;Here the end value of the animation, &lt;code&gt;opacity: 1&lt;/code&gt;, is the same as the normal value. So &lt;code&gt;forwards&lt;/code&gt; does nothing useful. Drop it.&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;.panel&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;animation&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;fade-in&lt;/span&gt; &lt;span class="m"&gt;0.3s&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;In our Chrome 156 test, this one change let the menu show above the box below it.&lt;/p&gt;

&lt;p&gt;If you really do need &lt;code&gt;forwards&lt;/code&gt;, give the panel a &lt;code&gt;z-index&lt;/code&gt; and &lt;code&gt;position: relative&lt;/code&gt; so you control where its box sits.&lt;/p&gt;

&lt;h2&gt;
  
  
  Other things that quietly create a stacking context
&lt;/h2&gt;

&lt;p&gt;These are the ones we run into most. The full list is on MDN.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a relatively or absolutely positioned box that also sets a number for &lt;code&gt;z-index&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;any &lt;code&gt;position: fixed&lt;/code&gt; or &lt;code&gt;position: sticky&lt;/code&gt; box, even when it has no &lt;code&gt;z-index&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;opacity&lt;/code&gt; below 1, such as &lt;code&gt;0.99&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;any non-&lt;code&gt;none&lt;/code&gt; &lt;code&gt;transform&lt;/code&gt;, &lt;code&gt;filter&lt;/code&gt;, &lt;code&gt;backdrop-filter&lt;/code&gt;, &lt;code&gt;clip-path&lt;/code&gt; or &lt;code&gt;mask&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;isolation: isolate&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;will-change&lt;/code&gt; that names one of those properties&lt;/li&gt;
&lt;li&gt;a child of a flex or grid layout that sets a number for &lt;code&gt;z-index&lt;/code&gt;, even without &lt;code&gt;position&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The last one surprises people. A flex or grid child with &lt;code&gt;z-index: 1&lt;/code&gt; can trap a menu just like a transform can.&lt;/p&gt;

&lt;h2&gt;
  
  
  Stop the next one before it starts
&lt;/h2&gt;

&lt;p&gt;The fixes above work. But on a big team the same bug keeps coming back. Someone adds &lt;code&gt;z-index: 1&lt;/code&gt; to a section, and a menu somewhere else breaks.&lt;/p&gt;

&lt;p&gt;Two habits help a lot.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Keep a small z-index scale
&lt;/h3&gt;

&lt;p&gt;Put every layer your app uses in one place.&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="nd"&gt;:root&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="py"&gt;--z-base&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="py"&gt;--z-raised&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="py"&gt;--z-header&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="py"&gt;--z-overlay&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;200&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="py"&gt;--z-modal&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;300&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="py"&gt;--z-toast&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;400&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.site-header&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;z-index&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="l"&gt;--z-header&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nc"&gt;.hero&lt;/span&gt;        &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;z-index&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="l"&gt;--z-base&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;Now nobody types 9999. They pick a named layer. And when two layers clash, you fix it in one file.&lt;/p&gt;

&lt;p&gt;This is common in design systems, and it works best for top-level page parts. Inside a component, small local numbers like 1 and 2 are fine, because they stay inside that component's stacking context anyway.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Seal off sections that use z-index inside
&lt;/h3&gt;

&lt;p&gt;If a section needs &lt;code&gt;z-index&lt;/code&gt; for its own inner layout, wrap it with &lt;code&gt;isolation: isolate&lt;/code&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;isolation&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;isolate&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;&lt;code&gt;isolation: isolate&lt;/code&gt; is on MDN's list of stacking context triggers. It makes the section a closed box without moving it. The z-index values inside it can no longer fight with the header or with menus from other parts of the page.&lt;/p&gt;

&lt;h2&gt;
  
  
  When a menu has to beat everything
&lt;/h2&gt;

&lt;p&gt;Some things, like a modal, must appear above the whole page no matter what. For those, the top layer is a better tool than any z-index.&lt;/p&gt;

&lt;p&gt;Elements opened with the Popover API or with &lt;code&gt;dialog.showModal()&lt;/code&gt; go into the browser's top layer. That layer sits above the normal page, so no ancestor can trap them. See the MDN links below for how each one works.&lt;/p&gt;

&lt;p&gt;We tested both bugs in Chrome 156 only, so please check your layout in Firefox and Safari too.&lt;/p&gt;

&lt;h2&gt;
  
  
  Quick checklist when z-index "does nothing"
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Find the element that is hidden and the element that covers it.&lt;/li&gt;
&lt;li&gt;Walk up from the hidden one. Look for the first ancestor that makes a stacking context (use the list above).&lt;/li&gt;
&lt;li&gt;Compare &lt;strong&gt;that ancestor&lt;/strong&gt; with the covering element, not the dropdown.&lt;/li&gt;
&lt;li&gt;Raise the ancestor, or remove the property that made the context.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Further reading&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Stacking context (MDN): &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_positioned_layout/Stacking_context" rel="noopener noreferrer"&gt;https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_positioned_layout/Stacking_context&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;z-index&lt;/code&gt; property (MDN): &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/z-index" rel="noopener noreferrer"&gt;https://developer.mozilla.org/en-US/docs/Web/CSS/z-index&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;isolation&lt;/code&gt; property (MDN): &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/isolation" rel="noopener noreferrer"&gt;https://developer.mozilla.org/en-US/docs/Web/CSS/isolation&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;animation-fill-mode&lt;/code&gt; property (MDN): &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/animation-fill-mode" rel="noopener noreferrer"&gt;https://developer.mozilla.org/en-US/docs/Web/CSS/animation-fill-mode&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Popover API (MDN): &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Popover_API" rel="noopener noreferrer"&gt;https://developer.mozilla.org/en-US/docs/Web/API/Popover_API&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;CSS 2 spec, Elaborate description of stacking contexts: &lt;a href="https://www.w3.org/TR/CSS2/zindex.html" rel="noopener noreferrer"&gt;https://www.w3.org/TR/CSS2/zindex.html&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;PIXEL RECRUITING LLC helps teams hire UI and design systems engineers, the people who keep layering rules like these tidy across a whole product. We are a direct staffing partner for Mastercard in O'Fallon, MO. Learn how we work at &lt;a href="https://pixelrecruiting.com" rel="noopener noreferrer"&gt;pixelrecruiting.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>css</category>
      <category>webdev</category>
      <category>frontend</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Why a Search Box Shrinks to 2px When You Add container-type</title>
      <dc:creator>Pixel Recruiting LLC</dc:creator>
      <pubDate>Fri, 30 Oct 2026 14:11:43 +0000</pubDate>
      <link>https://dev.to/pixelrecruiting/why-a-search-box-shrinks-to-2px-when-you-add-container-type-amo</link>
      <guid>https://dev.to/pixelrecruiting/why-a-search-box-shrinks-to-2px-when-you-add-container-type-amo</guid>
      <description>&lt;p&gt;You add one line of CSS to a search form. Then the form is gone.&lt;/p&gt;

&lt;p&gt;Well, not gone. DevTools says it is 2px wide. That is just its left and right border.&lt;/p&gt;

&lt;p&gt;The line is &lt;code&gt;container-type: inline-size&lt;/code&gt;. The plan was simple: the form should switch from a stacked layout to a side-by-side layout when it has room. Instead, it has no room at all.&lt;/p&gt;

&lt;p&gt;We rebuilt this bug on a test page to measure it. In our tests it came down to one rule, so let us look at that rule.&lt;/p&gt;

&lt;h2&gt;
  
  
  The setup
&lt;/h2&gt;

&lt;p&gt;Here is a cut-down version of the page. A header bar holds a logo on the left and a search form on the right.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;header&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"toolbar"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"logo"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Logo&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

  &lt;span class="nt"&gt;&amp;lt;form&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"search"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"search-inner"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;input&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"search"&lt;/span&gt; &lt;span class="na"&gt;placeholder=&lt;/span&gt;&lt;span class="s"&gt;"Search"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;button&amp;gt;&lt;/span&gt;Go&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/header&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.toolbar&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;justify-content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;space-between&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;align-items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;gap&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.search&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;container-type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;inline-size&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c"&gt;/* new: this is what breaks it */&lt;/span&gt;
  &lt;span class="nl"&gt;border&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1px&lt;/span&gt; &lt;span class="nb"&gt;solid&lt;/span&gt; &lt;span class="nx"&gt;#333&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.search-inner&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;flex-direction&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;column&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;gap&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0.5rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;@container&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;min-width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;30rem&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nc"&gt;.search-inner&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;flex-direction&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;row&lt;/span&gt;&lt;span class="p"&gt;;&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;Before the &lt;code&gt;container-type&lt;/code&gt; line, the form was as wide as its input and button. After it, the form measured 2px in Chrome 156 (we checked with &lt;code&gt;getBoundingClientRect()&lt;/code&gt;). The input and button spilled out over the edge.&lt;/p&gt;

&lt;h2&gt;
  
  
  What went wrong
&lt;/h2&gt;

&lt;p&gt;A query container has a deal with the browser. The browser agrees to work out the container's width &lt;strong&gt;without looking at its children&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The browser needs that deal. Your &lt;code&gt;@container&lt;/code&gt; rules change the children. If the children could also change the container's width, the two would keep changing each other forever.&lt;/p&gt;

&lt;p&gt;MDN puts it like this for &lt;code&gt;inline-size&lt;/code&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"The inline size of the element can be computed in isolation, ignoring the child elements"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now look at the toolbar again. The search form is a flex item. It has no &lt;code&gt;width&lt;/code&gt; and no &lt;code&gt;flex-grow&lt;/code&gt;. So how wide is it? As wide as its content.&lt;/p&gt;

&lt;p&gt;But the browser just promised to ignore the content. So the content counts as zero. All that is left is the border: 1px on each side, 2px total.&lt;/p&gt;

&lt;p&gt;MDN says the same thing in plain words:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"The container size has to be set by context, such as block-level elements that stretch to the full width of their parent, or explicitly defined. If a contextual or explicit size is not available, elements with size containment will collapse."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So the rule to remember is short. &lt;strong&gt;A container must get its width from outside, never from inside.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Places where width comes from inside
&lt;/h2&gt;

&lt;p&gt;These are the spots where an element sizes itself to its content. A container in any of them will collapse.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A flex item in a row with no &lt;code&gt;width&lt;/code&gt;, &lt;code&gt;flex-basis&lt;/code&gt; or &lt;code&gt;flex-grow&lt;/code&gt;. (Our bug.)&lt;/li&gt;
&lt;li&gt;A child of a column flexbox that uses &lt;code&gt;align-items: center&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;An element with &lt;code&gt;width: fit-content&lt;/code&gt; or &lt;code&gt;width: max-content&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Floats, &lt;code&gt;inline-block&lt;/code&gt; elements and absolutely positioned boxes with no width.&lt;/li&gt;
&lt;li&gt;A grid item that is centered with &lt;code&gt;justify-self: center&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We tried the first three in Chrome 156. All three came out 2px wide, which was just their borders. The same form inside a column flexbox with the default &lt;code&gt;align-items: stretch&lt;/code&gt; was full width, as expected.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fix 1: Let the flex item grow
&lt;/h2&gt;

&lt;p&gt;In a flex row, give the container a share of the free space.&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;.search&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;container-type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;inline-size&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt; &lt;span class="m"&gt;20rem&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;Now the width comes from the toolbar, which is outside. In our test the form filled the rest of the 1000px toolbar, and the &lt;code&gt;@container&lt;/code&gt; rule switched the layout to a row. When we made the page 400px wide, it switched back to a column. That is the behavior the form was meant to have from the start.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fix 2: Give it a real width
&lt;/h2&gt;

&lt;p&gt;If you don't want it to grow, set a width that does not depend on the children.&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;.search&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;100%&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;32rem&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nl"&gt;container-type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;inline-size&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;&lt;code&gt;min()&lt;/code&gt; picks the smaller value. On a wide screen the form is 32rem. On a small screen it can't get wider than its parent. Either way, the number comes from outside the form.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fix 3: Move the container up one level
&lt;/h2&gt;

&lt;p&gt;Sometimes you can't touch the width of the element. Maybe it comes from a shared component.&lt;/p&gt;

&lt;p&gt;In that case, make a different element the container. Pick an ancestor that already stretches, like a plain block &lt;code&gt;div&lt;/code&gt;. Then query that one.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"search-area"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;form&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"search"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;...&lt;span class="nt"&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.search-area&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;container&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;search-area&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nb"&gt;inline-size&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;@container&lt;/span&gt; &lt;span class="n"&gt;search-area&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;min-width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;30rem&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nc"&gt;.search-inner&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;flex-direction&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;row&lt;/span&gt;&lt;span class="p"&gt;;&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;The &lt;code&gt;container&lt;/code&gt; shorthand sets a name and a type at once. The name lets your &lt;code&gt;@container&lt;/code&gt; rule target this exact box, even if other containers sit around it.&lt;/p&gt;

&lt;p&gt;One thing to keep in mind: an &lt;code&gt;@container&lt;/code&gt; rule styles the container's &lt;strong&gt;descendants&lt;/strong&gt;, not the container itself. So put the container one level above the element you want to change.&lt;/p&gt;

&lt;h2&gt;
  
  
  A trap with &lt;code&gt;container-type: size&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;size&lt;/code&gt; is stricter than &lt;code&gt;inline-size&lt;/code&gt;. It ignores the children for the width &lt;strong&gt;and&lt;/strong&gt; the height.&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;.preview&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;container-type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;size&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;400px&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;This box has a width, but no height. In our test it came out 400px wide and 0px tall, so its text spilled out.&lt;/p&gt;

&lt;p&gt;If you need &lt;code&gt;size&lt;/code&gt;, give the box a height that does not come from its content. A fixed &lt;code&gt;height&lt;/code&gt; works. So does &lt;code&gt;aspect-ratio&lt;/code&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;.preview&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;container-type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;size&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;400px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;aspect-ratio&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;16&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="m"&gt;9&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 gave us a 400 by 225 box. For most layouts, though, &lt;code&gt;inline-size&lt;/code&gt; is all you need.&lt;/p&gt;

&lt;h2&gt;
  
  
  Find collapsed containers in one go
&lt;/h2&gt;

&lt;p&gt;Paste this in the DevTools console. It lists every container on the page that is less than 10px wide.&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="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;el&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelectorAll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;*&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;type&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;getComputedStyle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;el&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;containerType&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;type&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;normal&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;el&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getBoundingClientRect&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nx"&gt;width&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&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;warn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Collapsed container?&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;el&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;type&lt;/span&gt;&lt;span class="p"&gt;);&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;&lt;code&gt;normal&lt;/code&gt; is the default value of &lt;code&gt;container-type&lt;/code&gt;, so anything else is a container. On our test page this found all three broken forms and none of the fixed ones.&lt;/p&gt;

&lt;p&gt;In Chrome DevTools, the Elements panel also puts a &lt;code&gt;container&lt;/code&gt; badge next to query containers. That makes them easy to spot.&lt;/p&gt;

&lt;h2&gt;
  
  
  Browser support
&lt;/h2&gt;

&lt;p&gt;MDN marks &lt;code&gt;container-type&lt;/code&gt; as Baseline widely available and says "It's been available across browsers since February 2023." Our own tests ran in Chrome 156 only. We did not test Firefox or Safari this time, so please check the layout there too.&lt;/p&gt;

&lt;h2&gt;
  
  
  The short version
&lt;/h2&gt;

&lt;p&gt;Adding &lt;code&gt;container-type&lt;/code&gt; tells the browser to size the box without its children. If the box was relying on its children for its width, it shrinks to its borders. Give the width a source from outside: &lt;code&gt;flex-grow&lt;/code&gt;, an explicit &lt;code&gt;width&lt;/code&gt;, or a stretching parent that acts as the container instead.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sources&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;MDN, &lt;code&gt;container-type&lt;/code&gt;: &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/container-type" rel="noopener noreferrer"&gt;https://developer.mozilla.org/en-US/docs/Web/CSS/container-type&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;MDN, CSS container queries: &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_containment/Container_queries" rel="noopener noreferrer"&gt;https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_containment/Container_queries&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;MDN, Using CSS containment: &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_containment/Using_CSS_containment" rel="noopener noreferrer"&gt;https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_containment/Using_CSS_containment&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Chrome DevTools, Inspect CSS container queries: &lt;a href="https://developer.chrome.com/docs/devtools/css/container-queries" rel="noopener noreferrer"&gt;https://developer.chrome.com/docs/devtools/css/container-queries&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;CSS Conditional Rules Module Level 5, container queries (W3C): &lt;a href="https://www.w3.org/TR/css-conditional-5/" rel="noopener noreferrer"&gt;https://www.w3.org/TR/css-conditional-5/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;At PIXEL RECRUITING LLC we place frontend engineers who really understand CSS layout, including container queries and responsive components. We are also a direct staffing partner for Mastercard in O'Fallon, MO. Hiring, or looking for your next UI role? Start at &lt;a href="https://pixelrecruiting.com" rel="noopener noreferrer"&gt;pixelrecruiting.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>css</category>
      <category>webdev</category>
      <category>frontend</category>
      <category>beginners</category>
    </item>
    <item>
      <title>position: sticky Does Nothing? Hunt Down the Hidden Overflow</title>
      <dc:creator>Pixel Recruiting LLC</dc:creator>
      <pubDate>Thu, 29 Oct 2026 03:46:16 +0000</pubDate>
      <link>https://dev.to/pixelrecruiting/position-sticky-does-nothing-hunt-down-the-hidden-overflow-1k07</link>
      <guid>https://dev.to/pixelrecruiting/position-sticky-does-nothing-hunt-down-the-hidden-overflow-1k07</guid>
      <description>&lt;p&gt;You add &lt;code&gt;position: sticky&lt;/code&gt; and &lt;code&gt;top: 0&lt;/code&gt; to your header. You scroll. The header scrolls away like nothing happened.&lt;/p&gt;

&lt;p&gt;No error in the console. No warning in DevTools. Just a header that won't stick.&lt;/p&gt;

&lt;p&gt;This post explains the usual reason, shows a fix you can paste in, and gives you a small script that finds the problem for you.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem
&lt;/h2&gt;

&lt;p&gt;Someone posted this in a CSS forum. Here is the gist, in our own words.&lt;/p&gt;

&lt;p&gt;They wanted the header on their page to stay at the top while the user scrolled. They added &lt;code&gt;position: sticky&lt;/code&gt;. Nothing changed. They had already worked through a popular checklist of "why sticky isn't working": siblings, parent height, z-index, browser support. Still no luck.&lt;/p&gt;

&lt;p&gt;The answer that solved it was one line far away from the header: a wrapper higher up the page had &lt;code&gt;overflow: hidden&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Quick version of how sticky works
&lt;/h2&gt;

&lt;p&gt;A sticky element acts like a normal element until you scroll it to a set point. Then it "sticks" there, until its parent box scrolls out of view.&lt;/p&gt;

&lt;p&gt;Two key words here:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Scroll container:&lt;/strong&gt; a box that can scroll its content. Elements with &lt;code&gt;overflow&lt;/code&gt; set to &lt;code&gt;hidden&lt;/code&gt;, &lt;code&gt;auto&lt;/code&gt;, or &lt;code&gt;scroll&lt;/code&gt; can be one.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Containing block:&lt;/strong&gt; for our purposes, the parent box that the sticky element lives inside.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Root cause 1: an ancestor with &lt;code&gt;overflow: hidden&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;MDN says a sticky element sticks to its nearest ancestor that has a "scrolling mechanism." That is created when &lt;code&gt;overflow&lt;/code&gt; is &lt;code&gt;hidden&lt;/code&gt;, &lt;code&gt;scroll&lt;/code&gt;, &lt;code&gt;auto&lt;/code&gt;, or &lt;code&gt;overlay&lt;/code&gt;. It sticks to that ancestor &lt;strong&gt;even if that ancestor never actually scrolls&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;So here is what happens:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A wrapper has &lt;code&gt;overflow: hidden&lt;/code&gt;, maybe to clip a rounded corner or stop a sideways scrollbar.&lt;/li&gt;
&lt;li&gt;The sticky header now sticks to that &lt;strong&gt;wrapper&lt;/strong&gt;, not to the page.&lt;/li&gt;
&lt;li&gt;The wrapper never scrolls. The page does.&lt;/li&gt;
&lt;li&gt;The header rides along with the wrapper and scrolls off the screen.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here is a small example that shows it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"page"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;header&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"header"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;My site&lt;span class="nt"&gt;&amp;lt;/header&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;main&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"content"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;…lots of content…&lt;span class="nt"&gt;&amp;lt;/main&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.page&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;overflow&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;hidden&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;   &lt;span class="c"&gt;/* the hidden culprit */&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.header&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;sticky&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;top&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;z-index&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;white&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;We tested this in Chrome 156 and Firefox 157. After scrolling 500px, the header's top edge was at -500px. It scrolled away completely.&lt;/p&gt;

&lt;h3&gt;
  
  
  Fix A: remove the overflow
&lt;/h3&gt;

&lt;p&gt;If the &lt;code&gt;overflow: hidden&lt;/code&gt; isn't doing anything important, delete it. In our test the header then stayed at the top (top edge at 0px).&lt;/p&gt;

&lt;h3&gt;
  
  
  Fix B: use &lt;code&gt;overflow: clip&lt;/code&gt; instead
&lt;/h3&gt;

&lt;p&gt;Often the overflow is there for a reason, like hiding content that sticks out. In that case, use &lt;code&gt;clip&lt;/code&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;.page&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;overflow&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;clip&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;MDN explains the difference. &lt;code&gt;hidden&lt;/code&gt; gives the element a scrolling mechanism, so sticky treats it as a scroll container. &lt;code&gt;clip&lt;/code&gt; also hides the overflow, but the element is &lt;strong&gt;not&lt;/strong&gt; a scroll container. So the sticky header skips it and sticks to the page. In our test this fixed the header in both browsers.&lt;/p&gt;

&lt;p&gt;The trade-off: with &lt;code&gt;clip&lt;/code&gt;, nothing inside can be scrolled into view, not even with code. MDN warns that if there are focusable elements in the clipped area, keyboard users may not be able to reach them. Only use &lt;code&gt;clip&lt;/code&gt; when the clipped part has nothing interactive.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;overflow: clip&lt;/code&gt; support, per MDN's browser data: Chrome 90, Firefox 81, Safari 16.&lt;/p&gt;

&lt;h3&gt;
  
  
  Fix C: move the overflow somewhere else
&lt;/h3&gt;

&lt;p&gt;If you need &lt;code&gt;hidden&lt;/code&gt; (for example, you scroll that box with code), put it on an element that is &lt;strong&gt;not&lt;/strong&gt; an ancestor of the sticky element. For example, wrap only the content that needs clipping, and keep the header outside that wrapper.&lt;/p&gt;

&lt;h2&gt;
  
  
  The sneaky one: &lt;code&gt;overflow-x: hidden&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;Many sites add this to stop a sideways scrollbar:&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;.page&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;overflow-x&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;hidden&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;"But I only hid the x direction!" you say. Here is the catch. MDN explains that when one direction is &lt;code&gt;visible&lt;/code&gt; and the other is not &lt;code&gt;visible&lt;/code&gt; or &lt;code&gt;clip&lt;/code&gt;, the &lt;code&gt;visible&lt;/code&gt; one behaves as &lt;code&gt;auto&lt;/code&gt;. So &lt;code&gt;overflow-x: hidden&lt;/code&gt; quietly turns &lt;code&gt;overflow-y&lt;/code&gt; into &lt;code&gt;auto&lt;/code&gt;. Now the box is a scroll container, and sticky breaks.&lt;/p&gt;

&lt;p&gt;The fix is to use &lt;code&gt;clip&lt;/code&gt; for that direction:&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;.page&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;overflow-x&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;clip&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;&lt;code&gt;clip&lt;/code&gt; paired with &lt;code&gt;visible&lt;/code&gt; stays as is, so no scroll container is made. We tested both: &lt;code&gt;overflow-x: hidden&lt;/code&gt; broke the header, and &lt;code&gt;overflow-x: clip&lt;/code&gt; fixed it.&lt;/p&gt;

&lt;h3&gt;
  
  
  What about &lt;code&gt;html&lt;/code&gt; and &lt;code&gt;body&lt;/code&gt;?
&lt;/h3&gt;

&lt;p&gt;This one surprised us, so we tested it too:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Setup&lt;/th&gt;
&lt;th&gt;Header sticks? (Chrome 156, Firefox 157)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;overflow-x: hidden&lt;/code&gt; on &lt;code&gt;body&lt;/code&gt; only&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;overflow-x: hidden&lt;/code&gt; on both &lt;code&gt;html&lt;/code&gt; and &lt;code&gt;body&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;No&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;overflow-x: clip&lt;/code&gt; on both &lt;code&gt;html&lt;/code&gt; and &lt;code&gt;body&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;When only &lt;code&gt;body&lt;/code&gt; has it, browsers apply that overflow to the viewport (the browser window) instead, so sticky still works. When &lt;code&gt;html&lt;/code&gt; has it too, &lt;code&gt;body&lt;/code&gt; keeps its own overflow and becomes the trap. If you want a rule you never have to think about, use &lt;code&gt;overflow-x: clip&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Root cause 2: no offset set
&lt;/h2&gt;

&lt;p&gt;MDN notes that at least one inset (like &lt;code&gt;top&lt;/code&gt;, &lt;code&gt;bottom&lt;/code&gt;, &lt;code&gt;left&lt;/code&gt;, or &lt;code&gt;right&lt;/code&gt;) must be set to something other than &lt;code&gt;auto&lt;/code&gt;. Without it, &lt;code&gt;sticky&lt;/code&gt; acts just like &lt;code&gt;relative&lt;/code&gt;. We removed &lt;code&gt;top: 0&lt;/code&gt; in our test, and the header scrolled away.&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;.header&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;sticky&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;top&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c"&gt;/* required */&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Root cause 3: the parent is too short
&lt;/h2&gt;

&lt;p&gt;A sticky element can only stick while its parent box is on screen. A common setup looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;header&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"site-header"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Site title&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;nav&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"nav"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;…&lt;span class="nt"&gt;&amp;lt;/nav&amp;gt;&lt;/span&gt;   &lt;span class="c"&gt;&amp;lt;!-- sticky --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/header&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;main&amp;gt;&lt;/span&gt;…&lt;span class="nt"&gt;&amp;lt;/main&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;nav&lt;/code&gt; is sticky, but its parent is the &lt;code&gt;header&lt;/code&gt;. Once the header scrolls away, the nav goes with it. In our test, the nav was at -440px after a 500px scroll.&lt;/p&gt;

&lt;p&gt;The fix: move the sticky element so its parent is the tall, scrolling part of the page. Here, put the &lt;code&gt;nav&lt;/code&gt; after the &lt;code&gt;header&lt;/code&gt;, as a sibling of &lt;code&gt;main&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to verify
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Find the trap with a script.&lt;/strong&gt;&lt;br&gt;
Paste this into the browser console. Change the selector to match your sticky element:&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="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;el&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.header&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// your sticky element&lt;/span&gt;
  &lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;node&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;el&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;parentElement&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;node&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;node&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;node&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;parentElement&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;getComputedStyle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;node&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="se"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;hidden|auto|scroll|overlay&lt;/span&gt;&lt;span class="se"&gt;)&lt;/span&gt;&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;test&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;overflowX&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt; &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;overflowY&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&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="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Sticky is trapped by:&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;node&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;overflowX&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;overflowY&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&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;It lists every ancestor that can trap your sticky element. Click a result to jump to it in the Elements panel. One note: if &lt;code&gt;body&lt;/code&gt; shows up and &lt;code&gt;html&lt;/code&gt; does not, the body's overflow may be going to the viewport. Check that case with the table above.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Check the computed styles.&lt;/strong&gt;&lt;br&gt;
Select a suspect element and open the Computed tab. Look at &lt;code&gt;overflow-x&lt;/code&gt; and &lt;code&gt;overflow-y&lt;/code&gt;. Remember that a value you didn't write (like &lt;code&gt;auto&lt;/code&gt;) can show up because of the rule about pairs above.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Measure while scrolling.&lt;/strong&gt;&lt;br&gt;
Scroll down, then run:&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="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.header&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;getBoundingClientRect&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nx"&gt;top&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If it sticks, you'll see your &lt;code&gt;top&lt;/code&gt; value, such as &lt;code&gt;0&lt;/code&gt;. If you see a negative number, it scrolled away.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Test on a real page length.&lt;/strong&gt;&lt;br&gt;
Sticky only shows up when there's enough content to scroll. Test with real content, not a near-empty page.&lt;/p&gt;

&lt;h2&gt;
  
  
  Checklist
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;[ ] The sticky element has &lt;code&gt;top&lt;/code&gt; (or another inset) set.&lt;/li&gt;
&lt;li&gt;[ ] No ancestor has &lt;code&gt;overflow: hidden&lt;/code&gt;, &lt;code&gt;auto&lt;/code&gt;, or &lt;code&gt;scroll&lt;/code&gt;, unless you want it to stick inside that box.&lt;/li&gt;
&lt;li&gt;[ ] Use &lt;code&gt;overflow: clip&lt;/code&gt; or &lt;code&gt;overflow-x: clip&lt;/code&gt; when you only need clipping.&lt;/li&gt;
&lt;li&gt;[ ] The sticky element's parent is tall enough to scroll through.&lt;/li&gt;
&lt;li&gt;[ ] Add a &lt;code&gt;background&lt;/code&gt; and &lt;code&gt;z-index&lt;/code&gt; so content doesn't show through or sit above it.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Sources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;MDN: &lt;code&gt;position&lt;/code&gt; — &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/position" rel="noopener noreferrer"&gt;https://developer.mozilla.org/en-US/docs/Web/CSS/position&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;MDN: &lt;code&gt;overflow&lt;/code&gt; — &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/overflow" rel="noopener noreferrer"&gt;https://developer.mozilla.org/en-US/docs/Web/CSS/overflow&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;MDN browser compat data (&lt;code&gt;overflow: clip&lt;/code&gt;, &lt;code&gt;position: sticky&lt;/code&gt;) — &lt;a href="https://github.com/mdn/browser-compat-data" rel="noopener noreferrer"&gt;https://github.com/mdn/browser-compat-data&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;Shared by PIXEL RECRUITING LLC, where we match companies with frontend, UI and design systems engineers. Direct staffing partner for Mastercard · &lt;a href="https://pixelrecruiting.com" rel="noopener noreferrer"&gt;pixelrecruiting.com&lt;/a&gt; · &lt;a href="mailto:info@pixelrecruiting.com"&gt;info@pixelrecruiting.com&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>css</category>
      <category>frontend</category>
      <category>debugging</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
