Situation:
Given the following simplified HTML example:
- place the footer over the content, make it sticky.
- when scrolling to the bottom of the page: footer should disappear due to content
I was able to do this, but when I have html and body , both set the overflow-x property to hidden , those links in the footer cannot be clickable.
Update to situation:
I know that you can set z-indexes for #content to 2 and for footer to 1 to make the links clickable, but this prevents the use of multizoom.js from another part of the page and is not of my interest.
Question:
What did overflow-x for both html and body for links in the footer? And why do both elements set this property? (If only one of them omits overflow-x , links can be clicked)
Actually, it’s no longer a problem for me not to install overflow-x in the original project, because it has stayed away from the outdated styling attempt and has already been deleted. But I'm curious why such a strange behavior?
Example:
html, body { overflow-x: hidden; } #content { background: lightgrey; border-bottom: 1px solid black; height: 1500px; margin-bottom: 120px; } footer { background: grey; padding: 50px; line-height: 20px; text-align: center; z-index: -1; position: fixed; bottom: 0; width: 100%; } body { margin: 0; }
<html> <body> <div id="content"> Here is the content, scroll down until end of page </div> <footer> <a href="#">Here is the footer link (not clickable at the moment)</a> </footer> </body> </html>
xmoex source share