Unexpected line appears briefly when scrolling up — not caused by border or shadow in vanilla css, js and html
14:39 29 Nov 2025

Screenshot attached,I'm encountering a strange visual glitch on my website. When I scroll up, a horizontal line briefly appears near the top of the page and then disappears. I initially suspected it might be a box-shadow or border from one of the elements, but after inspecting the DOM and styles in the browser's dev tools, I couldn't find any such styling responsible for it.

  • It's not a persistent element — it only shows up momentarily during upward scroll.
  • I checked computed styles and layout boundaries but found nothing unusual.
  • The issue seems to occur only in certain scroll positions. I've attached screenshots showing the UI before and after scrolling, as well as the relevant DOM structure. Has anyone encountered something similar? What else should I check to identify the source of this transient line?

before scrolling

after scrolling

element home

element hero

javascript html css