1

I have a basic React Tailwind page:

export default function Home() {
  return (
    <div className="bg-gray-900 h-screen overscroll-none">
      <main className="text-white">
        <h2>Title</h2>
        <p>body</p>
      </main>
    </div>
  )
}

The entire page is black but when I scroll down it pulls the top of the page down (overscroll) revealing a white strip at the top.

enter image description here

How can I prevent this? I have tried overscroll-none

grabury
  • 4,797
  • 14
  • 67
  • 125
  • Have you tried applying the dark mode and over scroll styling to the body or :root element? Here’s details on how to do so for a similar use case in Tailwind CSS: https://stackoverflow.com/questions/72568312/tailwind-dark-mode-isnt-extending-fully-when-scrolling-all-the-way-on-page – ionosphere May 21 '23 at 16:38

1 Answers1

0
export default function Home() {
  return (
    <div className="bg-gray-900 h-screen overscroll-none overflow-hidden">
      <main className="text-white">
        <h2>Title</h2>
        <p>body</p>
      </main>
    </div>
  )
}

Using overflow-hidden stops overflow. I hope this helps!

Azureian
  • 11
  • 2