I want to be able to prevent some of the pages I’ve coded in HTML from scrolling and using URLs to take users away from those pages.
I’ve read that there is an element in the tag: ```scroll=“no”. Because there is only 1 tag, wouldn’t this stop scrolling throughout the website? I don’t want to eliminate all scrolling because some of my pages require it. I have other pages, like the home page that has a menu, where I want navigation to jump to a linked page only.
Can this be done? If so, how?
Hi @ahraitch So the scroll="no"
attribute can prevent scrolling but it is outdated and it is not supported in HTML 5. What you want to explore for your case is overflow: hidden;
<body style="overflow: hidden;">
this should prevent scrolling. Let me know if this works
1 Like
Thanks for the information. I didn’t know that scroll
had been deprecated. But, doesn’t putting the style="overflow: hidden;"
also risk the same issue, ie, apply to all pages instead of just the ones I choose to make it work on?
I tried this: <body style="overflow: hidden">.
I could not navigate past the first full screen of my website. That will work for my NAVBAR because I want to display that screen consisting of only links to other pages; however, there are other pages on my website that I want the user to be able to scroll down.
Since asking the question about scrolling, it has occurred to me that there are situations where I want to allow only paging down, not allowing scrolling. I know this can be done because I’ve seen it on website, but I don’t know how it’s done and haven’t found an article yet that describes how it’s done. My only thought was to create buttons for page forward/page back with URLs to the next and previous pages, but that seems like overkill.