How to hide the browser scrollbar using CSS
by Nathan Sebhastian
Posted on Aug 21, 2021
Reading time: 2 minutes
The browser scrollbar can be hidden from view by applying the CSS property overflow:hidden to the body tag.
For example, suppose you have a long <div> thatās scrollable as follows:
You can hide the scrollbar from the browser by adding the overflow:hidden property to the body tag as shown below:
Now the scrollbar will be hidden from view, but you wonāt be able to scroll the browser content either.
If you want to hide the scrollbar and still enable scrolling, then you need to apply a CSS styling to the specific browser you want to affect.
To hide the scrollbar from Chrome, Safari, Edge, and Opera, you can use the pseudo-element selector :-webkit-scrollbar and set the display property to none .
Hereās the CSS syntax:
To hide the scrollbar from Firefox, you need to add the scrollbar-width:none property to the html tag as follows:
Applying the CSS above to the body tag used to work on older Firefox versions, but now you need to apply the style to the html tag.
Still, if you have a container <div> with a maximum height or width property, you can apply the scrollbar-width:none property to the container element to hide the scrollbar only in that container:
Hereās an example:
Finally, if you need to support Internet Explorer, then you need to add the -ms-overflow-style:none property to the container:
And thatās how you can hide the browser scrollbar using CSS.
Take your skills to the next level ā”ļø
I'm sending out an occasional email with the latest tutorials on programming, web development, and statistics. Drop your email in the box below and I'll send new stuff straight into your inbox!
Hello! This website is dedicated to help you learn tech and data science skills with its step-by-step, beginner-friendly tutorials. Learn statistics, JavaScript and other programming languages using clear examples written for people.
Learn more about this website
Connect with me on Twitter
Or LinkedIn
Type the keyword below and hit enter
Click to see all tutorials tagged with:
How To Prevent Scrolling The Page On iOS Safari 15
If we show a modal on iOS we need to prevent events inside the modal from interacting with the page behind the modal. On a previous episode of āFun with Safariā we could use preventDefault() on the "touchmove" event but on iOS 15 that no longer works. Here we go.
To make this work we need iOS to think that there is nothing to scroll.
But how do we do this?
We set the height of both the html and the body element to the window height and then set overflow on these elements to hidden so the content gets cut off.
For now itās set to 100px .
A height of 100vh
A vh is a viewport height unit, 1vh means 1% of the viewport height.
Great. Letās set the measure to 100vh and observe what happens.
Nope. This is not going to work. On iOS 100vh is always the full height of the viewport, even if the footer shows.
If youāre browsing this page on iOS Safari, scroll up and down a bit to see the height stays fixed no matter of the footer is active or not.
Using -webkit-fill-available
Letās try the -webkit-fill-available property instead.
This is a -webkit- thing, so if youāre on Firefox the measure will now snap to 0
This will do the trick. But it results in a modal that is not filling up all available space.
-webkit-fill-available will fill the āsafeā space, so it excludes the room the footer will take up if itās active.
We want all the space.
It turns out that window.innerHeight reflects the actual available space. So what we want is this.
But you and I both know that this wonāt fly because window.innerHeight is a JavaScript property.
Syncing window.innerHeight
Luckily we can use CSS Custom Properties to make this tick.
Now we switch to JavaScript land where we update the custom property when the window is resized.
The 'resize' event is trigged when the iOS Safari footer changes in height, so this nicely aligns our measure with the page height.
I know we could also ājustā set measure.style.height but as weāre going to use Custom Properties for our modal in a minute so we might as well go the extra mile here.
If youāre on iOS, see if the measure scales correctly by scrolling up and down a bit.
Weāre almost out of the woods. Our measure is now be the right size no matter if the iOS Safari footer is visible or not.
Now weāre going to apply this height to the html and body elements when our modal is activated. This prevents the page from scrolling.
Weāll add an is-locked class to our html element when we show the modal.
When the is-locked class is assigned we use it to set the required styles so the page cannot be scrolled.
Wait a minute, what is that calc() doing there?!
Let me try to explain. If the iOS Safari footer is hidden when the modal opens, iOS will reveal the footer if the user makes a vertical pan gesture, the 1px prevents this from happening.
I donāt know why, I just know that Iām so tired. š¤·āāļø
Letās just move on.
Now we listen for the 'resize' event to keep the --window-inner-height CSS Custom Property synced with the window.innerHeight in JavaScript land.
To prevent iOS from hiding the footer when the modal is visible and the footer is visible we need to prevent the default action of the 'pointermove' event.
If we want to support iOS 14 we need to add 'touchmove' as well.
Weāre nearly done. š«
Because weāre resizing the document the user scroll position is lost when the modal opens. So we need to remember that position before it opens and restore it when the modal closes.
There we go! š
Try it out on iOS Safari 15 by clicking the āOpen modalā button below. Itās been tested with the address bar at the bottom of the viewport (which is the default) and at the top. We can move it to the top by tapping āaAā and then āShow Top Address Barā.
The modal is slightly transparent on purpose so we can see that the page is scrolled to the top. We can assign the backdrop-filter: blur(20px) style to the modal root element to make this less obvious.
I sincerely hope the Apple Safari dev team will fix this mess in the next upate, but Iām not holding my breath.
I share web dev tips on Twitter, if you found this interesting and want to learn more, follow me there
Or join my newsletter
Busy doing the newsletter subscribing.
Something went wrong, can you give it another go?
At PQINA I design and build highly polished web components.
Make sure to check out FilePond a free file upload component, and Pintura an image editor that works on every device.
Related articles
Typescript interface merging and extending modules, blocking navigation gestures on ios safari, styling password fields to get better dots.
Advisory boards arenāt only for executives. Join the LogRocket Content Advisory Board today →
- Product Management
- Solve User-Reported Issues
- Find Issues Faster
- Optimize Conversion and Adoption
- Start Monitoring for Free
Using CSS to hide scrollbars without impacting scrolling
Editorās note: This article was last updated on 24 October 2023 to address accessibility concerns related to hiding scrollbars and to include visual examples of including, hiding, and conditional hiding scrollbars.
Scrollbars can make an otherwise elegant website look outdated, reminiscent of the 90s. Thanks to new CSS properties, itās now possible to style and hide scrollbars without impacting the userās ability to scroll.
The scrollbar in the browser allows the user to scroll up and down on the page without having to take their hands off the keyboard or trackpad. However, for the sake of achieving a more streamlined appearance, certain websites choose to alter, customize, or completely hide the scrollbar, either for the entire webpage or specific elements.
This guide will show you how to hide the scrollbar in popular web browsers by making use of modern CSS techniques. To get the most out of this article, you should have a basic understanding of HTML and CSS.
Reasons to hide the scrollbar
While itās generally recommended to avoid altering or overriding default browser styles for accessibility reasons, there can be compelling justifications for hiding scrollbars.
Scrollbars appear automatically when web content exceeds the available space within the browser window. This behavior is managed by user-agent styles, which are responsible for the default browser styling.
A scrollbar provides a visual cue for scrolling using a mouse or keyboard, but itās unnecessary in specific layout patterns, particularly those that donāt require scrolling interactions, such as a slideshow, news tickers, image galleries, etc. In such patterns, hiding the scrollbar can create a smoother interaction and eliminate distractions from the overall feature.
By hiding scrollbars, you can reclaim the space they occupy, adding to your screenās real estate. This not only streamlines the UI but also allows for a cleaner and more spacious design.
Another common motivation for hiding scrollbars is to enhance the mobile viewing experience. On mobile devices, especially smartphones, users typically expect vertical scrolling, with no need for horizontal movement, as screens are usually tall and narrow, and content flows from top to bottom. Keeping the horizontal scrollbar hidden creates a more natural feel and reduces attention to the technical aspects of browsing.
If youāre wondering how to hide or remove these scrollbars correctly, this tutorial covers everything you should know to accomplish that.
Methods to hide the scrollbar
There are two different methods to hide the scrollbar for a webpage or a specific element within it. The first method involves setting the overflow property to hidden , which effectively hides the scrollbar:
However, this method also takes away the ability to scroll and greatly affects basic accessibility. This is where the scrollbar-specific CSS pseudo-selectors come into play, which we will briefly discuss in the next few sections.
Over 200k developers use LogRocket to create better digital experiences
Essential CSS properties to hide scrollbars
Apart from the overflow CSS property, you primarily need just two more CSS features to manage the appearance of scrollbars:
- -webkit-scrollbar : To target scrollbars in all WebKit-based browsers. Itās worth noting that while this method has been around for a while, it has not yet been standardized and is likely to become obsolete as the new scrollbar properties become universally adopted
- scrollbar-width : To target scrollbars in Gecko-based browsers. This property is part of the new scrollbar properties and is currently supported exclusively in Firefox
Along with these two CSS features, we will employ additional presentational CSS properties to enhance the appearance of the upcoming examples in later sections.
Each browser-rendering engine has its unique approach to managing scrollbar visibility, leading to the use of various vendor-specific CSS pseudo-selectors and properties. Letās briefly look at them and their usage.
Hiding the scrollbar on Chrome, Edge, and other WebKit-based browsers
You can use the ::-webkit-scrollbar pseudo-selector to hide the scrollbar in Chrome, Edge, Opera, Safari, and other WebKit-based browsers. Obviously, this is currently not the standard way ā itās a vendor-specific selector that is supported by a limited category of browsers.
The -webkit-scrollbar pseudo-selector provides a wide range of options for customizing a scrollbar. You can adjust the appearance of the up and down arrows, modify the scrollbar thumbās and trackās color, change the background, and more. In this example, weāll focus on how to hide the scrollbar without affecting the ability to scroll:
See the Pen Hiding the vertical scrollbar by Rahul ( @_rahul ) on CodePen .
As you can see in the above demo, the scrollbar is hidden, but the page remains scrollable using both the mouse and keyboard. Note that this demo covers the hidden scrollbars in Chrome, Edge, and WebKit-based browsers only.
Microsoft web browsers
Browsers developed by Microsoft also support the ::-webkit-scrollbar pseudo-selector for adjusting scrollbar visibility and other appearance properties.
If you prefer not to use the -webkit-scrollbar pseudo-selector, you can use the -ms-overflow-style property to control the scrollbar visibility. Note that this property is specific to Microsoft Edge and Internet Explorer, and wonāt function in other browsers:
Gecko-based browsers
For Gecko-based browsers like Firefox, you have the option to use the scrollbar-width property to control the scrollbar visibility. This CSS property is expected to be available in other browser engines soon and may become the standard method for controlling the visibility and width of scrollbars with CSS:
Hereās an implementation using all the pseudo-selectors and properties discussed above, which makes this example functional on all modern web browsers that implement WebKit, Edge, or Gecko rendering engines:
See the Pen Untitled by Rahul ( @_rahul ) on CodePen .
While this approach might appear sophisticated to developers, it doesnāt really offer any visual cues or indications to users regarding the presence of additional content below the current view. This lack of clarity can potentially result in a significant accessibility issue.
Conditionally hiding the scrollbar
If there is a specific section on your website with scrollable content, maintaining a visible scrollbar is advantageous for both usability and accessibility. However, as discussed earlier, a constantly visible scrollbar can compromise the aesthetics of your siteās UI in certain cases.
In such situations, you can make the scrollbar visible only upon hovering. This implies that if the target section is not in use, the scrollbar remains hidden.
Take the following implementation as an example, featuring a vertically scrollable element. The markup part is straightforward and doesnāt directly affect the presentation or functionality of the scrollable element:
In the CSS part, constraining the height of the .scrollable-content div and hiding its overflow establish the foundation for making it truly scrollable. While this may initially result in an unpolished appearance, we can enhance its visual appeal by incorporating additional CSS properties. Iām focusing on the essential CSS properties in the code below:
Now, changing the vertical overflow to scroll upon hover will ensure that the scrollbar appears only when the user intends to use the .scrollable-content section. To provide a seamless user experience, we should extend this functionality beyond just hovering.
By incorporating the :active and :focus pseudo-classes, users can utilize the mouse wheel to scroll up and down the scrollable element:
See the Pen Scrollable Elements w/ CSS by Rahul ( @_rahul ) on CodePen .
As evident in the example above, hovering triggers the appearance of the vertical scrollbar but also introduces a slight text and layout shift within the scrollable element. This occurs because the browser adjusts the scrollable element to accommodate the vertical scrollbar. This adjustment may disrupt the overall visual flow.
To eliminate this shift and achieve a smoother scrollbar appearance, you can integrate the scrollbar-gutter CSS property, which essentially prepares the element for potential layout adjustments caused by scrollbars.
By setting the value to stable , the scrollbar-gutter property will pre-adjust the element only from the edge where the scrollbar is intended to be added. Setting it to stable both-edges will pre-adjust it from both edges to maintain a proportional appearance:
For additional enhancements, you can go the extra mile and stylize the scrollbar using the scrollbar-specific pseudo-elements. Hereās a demo showcasing a scrollable element with a decorated scrollbar without any layout shifts:
See the Pen Smart Scrollable Elements Using CSS by Rahul ( @_rahul ) on CodePen .
Accessibility concerns: Is hiding the scrollbar bad for UX?
Hiding scrollbars in web design has its pros and cons. On the upside, it can make your design look clean and appealing, especially when scrollbars arenāt necessary. This approach maximizes the screen space which is great for mobile users who are accustomed to vertical scrolling and donāt usually need horizontal scrolling. Check out this guide to styling CSS scrollbars for more information .
However, hiding scrollbars on a website can pose accessibility challenges, especially for users who rely on assistive technologies. This includes individuals who use screen readers, those with limited fine motor control, or people with cognitive disabilities. When scrollbars are hidden, these users may struggle to determine if a page is scrollable or to gauge how far theyāve scrolled.
The decision to hide scrollbars should be made carefully. When done right, it can enhance your design, but itās crucial to strike a balance between aesthetics and user-friendliness, ensuring that your website remains accessible and usable. Consider providing hints of scrollbars or alternative scrolling methods, such as keyboard commands, or offer users the option to toggle the scrollbar on and off.
Hereās a quick demonstration showcasing both scrollbars hinting and toggling to maintain visibility. The demo implements the previously covered code examples and uses a bit of JavaScript for toggling between two different scrolling functionalities:
See the Pen Smart and Accessible Scrollable Elements w/ CSS by Rahul ( @_rahul ) on CodePen .
As an assignment, you may attempt to toggle the scrollbar visibility using a keyboard shortcut with JavaScript.
Note that hiding or showing scrollbars with CSS wonāt significantly impact page load or rendering times. Using CSS to style scrollbars might require a bit more CSS, but it wonāt noticeably affect load or rendering times. The same applies to hiding scrollbars with CSS. If youāre using a JavaScript library to manage the scrollbar display, I recommend doing that with CSS to reduce the overall page size and load time.
You now have a good grasp of hiding scrollbars with CSS while maintaining smooth scrolling and accessibility. While hiding scrollbars may be suitable for certain UI and aesthetic considerations, itās essential to remember that keeping scrollbars visible in scrollable sections helps users easily locate and navigate content, thereby enhancing accessibility.
I hope this article has been helpful to you. See you in the next one.
Is your frontend hogging your users' CPU?
As web frontends get increasingly complex, resource-greedy features demand more and more from the browser. If youāre interested in monitoring and tracking client-side CPU usage, memory usage, and more for all of your users in production, try LogRocket .
LogRocket is like a DVR for web and mobile apps, recording everything that happens in your web app, mobile app, or website. Instead of guessing why problems happen, you can aggregate and report on key frontend performance metrics, replay user sessions along with application state, log network requests, and automatically surface all errors.
Modernize how you debug web and mobile apps ā start monitoring for free .
Share this:
- Click to share on Twitter (Opens in new window)
- Click to share on Reddit (Opens in new window)
- Click to share on LinkedIn (Opens in new window)
- Click to share on Facebook (Opens in new window)
Stop guessing about your digital experience with LogRocket
Recent posts:.
Building web-based terminal components with Termino.js
Explore Termino.js, an open source library for integrating web-based terminals into applications, in this introduction article.
How to build a custom GPT: Step-by-step tutorial
Let’s see why and how to build custom GPTs ā personalized versions of ChatGPT that act as custom chatbots to serve a specific purpose.
Jest adoption guide: Overview, examples, and alternatives
Jest is feature-rich testing framework that comes with several in-built features that make it powerful and easy to use.
Implementing LiveViews in Node.js
Explore LiveViewJS and how to build a full-stack Node.js app with LiveViews that supports real-time interactivity.
Leave a Reply Cancel reply
How TO - Hide Scrollbar
Learn how to hide scrollbars with CSS.
How To Hide Scrollbars
Add overflow: hidden; to hide both the horizontal and vertical scrollbar.
To only hide the vertical scrollbar, or only the horizontal scrollbar, use overflow-y or overflow-x :
Note that overflow: hidden will also remove the functionality of the scrollbar. It is not possible to scroll inside the page.
Tip: To learn more about the overflow property, go to our CSS Overflow Tutorial or CSS overflow Property Reference .
Advertisement
Hide Scrollbars But Keep Functionality
To hide the scrollbars, but still be able to keep scrolling, you can use the following code:
Webkit browsers, such as Chrome, Safari and Opera, supports the non-standard ::-webkit-scrollbar pseudo element, which allows us to modify the look of the browser's scrollbar. IE and Edge supports the -ms-overflow-style: property, and Firefox supports the scrollbar-width property, which allows us to hide the scrollbar, but keep functionality.
COLOR PICKER
Report Error
If you want to report an error, or if you want to make a suggestion, do not hesitate to send us an e-mail:
Top Tutorials
Top references, top examples, get certified.
Struggling with internal tools?
Explore refineās limitless possibilities in crafting CRUD apps, CRM solutions, HR dashboards, and more!
How to Hide Scrollbar Using CSS?
Introduction ā.
A scrollbar is a GUI element that appears on the right side (or bottom corner) of a webpage or web application to let users navigate a page or an element up and down (and also left and right) without taking their hands off the keyboard or trackpad. However, the default scrollbar may appear bland and out of place, diminishing the overall aesthetics of the webpage or web application.
With the help of new CSS attributes, scrollbars can now be styled and hidden without affecting the user's ability to scroll. In this article, we will demonstrate how to hide the scrollbar in most web browsers using CSS .
Steps we'll cover:
- CSS properties to hide element scrollbars.
- Hide scrollbars on specific elements.
- CSS properties to hide browser scrollbars.
- Hide scrollbars in Webkit browsers like Chrome, Safari, Edge, and Firefox.
CSS properties to hide element scrollbars ā
- The CSS property overflow: hidden is used to hide the vertical and horizontal scrollbar on an element. However, This property also affects the element's ability to scroll on its vertical and horizontal axis.
- The CSS property overflow-y: hidden is used to hide the vertical scrollbar on an element. This property also affects the element's ability to scroll on its vertical axis.
- The CSS property overflow-x: hidden is used to hide the horizontal scrollbar on an element. This property also affects the element's ability to scroll on its horizontal axis.
- A pseudo selector ::-webkit-scrollbar , which is only supported for webkit browsers. In the pseudo selector, you can define the display: none property which would hide the scrollbar on the element but retain its scrolling function.
- The -ms-overflow-style: none property which is only supported for for Edge and other legacy browsers like IE.
- The scrollbar-width: none property which is supported by Firefox.
Hide scrollbars on specific elements ā
We will demonstrate how to hide scrollbars using the CSS attributes mentioned earlier.
Below is a codepen example that shows how to hide an element's scrollbar without affecting its ability to scroll.
In this example, we used the ::-webkit-scrollbar pseudo-selector to hide the scrollbar on the element with a class scroll-container while maintaining its functionality.
Another example is using the property overflow: hidden to hide the scrollbar. However, as shown on the codepen, it affects the element's ability to scroll.
The overflow: hidden property is applied on the element with class scroll-container with a max-height: 350px .
CSS properties to hide browser scrollbars ā
The pseudo selector -webkit-scrollbar can also be used to target browser scrollbars in all WebKit-based browsers. However, while this method has been around for a while, it has yet to be standardized and is likely to become outdated once the new scrollbar characteristics provided by MDN are fully implemented and supported in all browsers.
The browser's scrollbar can be hidden when the CSS properties overflow: hidden , overflow-y: hidden , or overflow-x: hidden are added to the body element (the root element). Nonetheless, it is not recommended to apply them to the base body element since it may interfere with the browser's ability to scroll on that page.
Hide scrollbars in Webkit browsers like Chrome, Safari, Edge, and Firefo ā
We will demonstrate how to hide browser scrollbars using the CSS properties mentioned earlier.
The codepen example that follows demonstrates how to conceal the browser's scrollbar without impairing its scrolling functionality.
In this example, we used the ::-webkit-scrollbar pseudo-selector to hide the scrollbar on the body element while maintaining its functionality.
Another option is to conceal the scrollbar by using the CSS property: overflow: hidden . Nevertheless, it has an impact on the browser's scrolling capability (which is not advisable) on that page, as seen on the codepen.
The overflow: hidden property is applied to the body element.
Conclusion ā
In this article, we explained how to hide scrollbars at the element and page levels using CSS. Scrollbars should be hidden for certain UI and aesthetic reasons, but it's crucial to remember that accessibility is improved when scrollbars are displayed in scrollable sections because they make it easier for users to find and navigate content.
Related Articles
In this post, we see how to use Heroicons with TailwindCSS.
In this brief guide, we compare some concept of the two most popular CSS layout methods - Grid and Flexbox.
In this brief guide, we'll create a responsive navbar with Tailwind CSS and Bootstrap in React.
- Introduction
- CSS properties to hide element scrollbars
- Hide scrollbars on specific elements
- CSS properties to hide browser scrollbars
- Hide scrollbars in Webkit browsers like Chrome, Safari, Edge, and Firefo
Home Ā» Tech Tips Ā» Mac Ā» How to Show or Hide Scroll Bars in Mac?
How to Show or Hide Scroll Bars in Mac?
Sometimes the new user interface design concepts make us sick. On the name of UI design companies remove the handy features used by people for many years. Scroll bars are shown vertically and horizontally if the visible content exceeds the width of the appās display window. When you read long document or webpage, it helps to know the position where you are and estimate the remaining length of the content. For most of us, it works like looking at the remaining pages when you are reading a book. Long back Apple removed, the fixed scroll bars and shows them when you move the mouse or based on trackpad gestures. In this article let us discuss how to bring the scroll bars in Mac permanently back and few other customizing options for you to make it easy.
Related: How to show desktop in Mac?
Bring Missing Scroll Bars in Mac
If you are not seeing the scroll bar on Safari, Pages or any other app then simply move the mouse or cursor using trackpad. This will make the scroll bar visible. However, this is not convenient as it may disappear before you may catch to drag it to the required position. The solution is simple; you need to make it visible permanently.
Scroll Bar Options in macOS 12 or Earlier
Since the settings are different in macOS 13 (Ventura) or later, first we explain with older macOS versions (12 or earlier).
Click on āApple menuā and go to āSystem Preferencesā¦ā section.
Click on āGeneralā preferences option.
You will have three options under āShow scroll barsā.
Automatically based on mouse or trackpad
This is a tricky option to understand. It can be better understand with and without an external mouse connected to your Mac. First enable this and open any default app like Preview or Safari or Pages showing a lengthy document. You will NOT see any scrollbar unless you move the cursor up or down using trackpad movement.
Now plugin your mouse using a cable or USB and check the document. You will permanently see the scroll bars. You can move the bars either using mouse or using trackpad, arrow keys or spacebar.
So enabling automatic option will basically show the scroll bars when you have a mouse plugged. And toggle the scroll bar based on trackpad movement when you have no external mouse.
When scrolling
This option does the same function as previous option without external mouse. That means, you will see the scroll bars only when you move the cursor up or down using double finger swipe.
This is a good option, in our opinion, to bring the scroll bar permanently back regardless of you have external mouse or not. Choose this option to work smoothly with your documents.
Related: How to manage desktop in Mac?
Scroll Bar Movement
Simply enabling scroll bar is not sufficient in most cases. Generally you may expect the content to move to the scroll bar position where you have clicked on the sidebar. Unfortunately, Mac will move page by page regardless of where you click the sidebar. You can simply drag and drop the scroll bar to the required position. However, you can also customize the scroll bar click in āGeneral preferencesā under āClick in the scroll bar toā section.
- Jump to the next page ā this is a default option which will move to next page on the document regardless of where you click on the scroll bar.
- Jump to the spot thatās clicked ā probably this is what you will expect to happen when you click on the middle of the scroll bar and you are at the middle immediately.
Using Arrows and Spacebar
Instead of scroll bars, you can also use arrow keys to navigate through the documents. This is especially useful for vertical scrolling.
- Use up or down arrow to move click by click which will move few lines up or down on the document.
- Press spacebar to quickly go to next page.
Scrolling Direction of Scroll Bars in Mac
Another factor when using vertical scroll bar using trackpad is the scrolling direction. For most of us, the scrolling needs to be on the opposite direction of the double finger swiping direction. This means when you swipe double fingers down the content will move up and vice versa. This is called unnatural scrolling.
However, natural scrolling is when you swipe the fingers down the content also will move down and vice versa. This means the content will track the direction of your finger movement.
- Go to āApple Menu > System Preferencesā¦ā and click on āTrackpadā option.
- Click on āScroll & Zoomā tab.
- Enable or disable āScroll direction: Naturalā option to setup the scrolling direction.
Scroll Bars Option in macOS 13 (Ventura or Later)
If you are using macOS Ventura, Sonoma or later versions then the interface may look bit different with similar set of options.
- Click the Apple logo and go to “System Settings…” menu.
- Go to “Appearance” section and then scroll down to the bottom on the settings page.
- Select your preference under “Show scroll bars” section.
Similarly, you can setup the scrolling direction from “Trackpad” settings page.
Scroll Bars in Mac Third Party Apps
All the scroll bar settings, except the direction, apply only to the default Apple apps like Pages, Safari , Finder, Preview, etc. This will NOT work for the third party apps like Google Chrome.
- Scroll bars are always visible on most of third party apps regardless of your settings in general preferences.
- You can move the scroll bar and the content to the clicked position though you have set āJump to the next pageā in preferences.
In our opinion, these are the ideal settings for apps in order to have easy navigation.
About Editorial Staff
Editorial Staff at WebNots are team of experts who love to build websites, find tech hacks and share the learning with community.
You also might be interested in
How to Customize Microsoft Edge Browser?
There are several things you can customize on your Microsoft[...]
How to Fix App Crashing Issues in iPhone?
There are millions of free and premium apps available in[...]
How to Use Handoff Between iPhone and Mac?
One of the biggest success factors behind Apple devices is[...]
Leave your reply.
I found that with OS 16.0.1 that that menu was in the Appearance menu and not the General. Thanks for the information. I think it is going to work. //… Joe
Thank you so much for this article. It’s very helpful! I’m new to MacBook and I’m impressed with the trackpad gestures that I missed out and it’s so important for navigation. You should’ve included a link to Apple’s article about its multi-touch gestures! ?
DOWNLOAD EBOOKS
- SEO Guide for Beginners
- WordPress SEO PDF Guide
- Weebly SEO PDF Guide
- Alt Code Emoji Shortcuts PDF
- ALT Code Shortcuts PDF
- View All eBooks
TRENDING TECH ARTICLES
- 600+ Windows Alt Codes for Symbols
- Fix Chrome Resolving Host Problem
- Fix Slow Page Loading Issue in Google Chrome
- View Webpage Source CSS and HTML in Google Chrome
- Fix Safari Slow Loading Pages in macOS
- Fix Windows WiFi Connection Issue
- ROYGBIV or VIBGYOR Rainbow Color Codes
- Fix Iām Not A Robot reCAPTCHA Issue in Google Search
- Structure of HTTP Request and Response
POPULAR WEB TUTORIALS
- Move WordPress Localhost Site to Live Server
- Move Live WordPress Site to Localhost
- Move WordPress Media Folder to Subdomain
- Fix WooCommerce Ajax Loading Issue
- Create a Free Weebly Blog
- Edit Weebly Source Code HTML and CSS
- Add Scroll To Top Button in Weebly
- Add Table in Weebly Site
- How to Add Advanced Data Table Widget in Weebly?
- Up to $500 Free Google Ads Coupon Codes
FREE SEO TOOLS
- Webpage Source Code Viewer
- HTTP Header Checker
- What is My IP Address?
- Google Cache Checker
- Domain Age Checker Tool
- View All Free Web and SEO Tools
Ā© 2024 Ā· WebNots Ā· All Rights Reserved.
Type and press Enter to search
How to Easily Disable Smooth Scrolling on Safari for Mac
Learn about smooth scrolling on Mac
Enable and Access Safari Debug Menu via Terminal command
Disable Smooth Scrolling and hide debug menu using Terminal.
Apple introduced smooth scrolling on Mac with Safari 16.4 Usually, the scrolling seems jittery when you use arrow keys and try to access a large webpage. Smooth scrolling tries to fix this by continuously scrolling until a key is released. Or you have to press the mouse button to stop the scrolling. Many have reported that smooth scrolling causes eye strain and difficulty in focusing. Let us learn how to turn off smooth scrolling on macOS.
Unfortunately, there is no native way to disable smooth scrolling. Either you are stuck with it or follow the steps in this article to disable smooth scrolling. The feature is automatically activated when you keep pressing the up or down arrow mark.
I have noticed that smooth scrolling often interferes with other functions. For instance, the gesture stops working when you access multiple pages with smooth scrolling. I only wished Apple had added a checkbox to turn off this feature on Safari.
How to Disable Smooth Scrolling
The solution to this problem lies in multiple parts. Firstly, you need full disk access for the Terminal. It is required as you have to unhide Safariās hidden debug menu. Once done, turn off smooth scrolling using the debug menu. It might seem overwhelming, but the steps are simple and easy to follow.
1. Enable Full Disk Access
Time needed: 3 minutes
For the sake of convenience, we have segregated the solution into different sections.
2. Open and Access the Safari Debug Menu
1. Close Safari browser if open.
2. Open the Terminal app. Head over to Applications>Utilities .
3. Copy and paste the command below. Ensure that there is no white space or typo. Once done, press Return.
defaults write com.apple.Safari IncludeInternalDebugMenu -bool true
Kudos! You have enabled full disk access and successfully opened the Safari debug menu. In the next part, you must turn off smooth scrolling using the debug menu.
3. Disable Smooth Scrolling on Safari
With the help of Terminal, you can change hidden Safari settings. Let us use this method to turn off smooth scrolling on Mac. Quit Terminal and open Safari.
Select Debug>Webkit Internal Features> EventHandlerdriven smooth keyboard scrolling from the debug menu. Ensure that the checkmark is removed. Now, by default, the debug menu stays on the Safari browser.
However, you can disable or hide it using the following Terminal command.
defaults write com.apple.Safari IncludeInternalDebugMenu -bool false
Note that hiding the Safari debug menu will not affect any settings. The only thing is you cannot alter them.
Some features like Smooth scroll are polarising in nature. Users should have the option to turn such features on or off. You can disable Smooth scrolling on Mac by following the steps above. Did you know Safari lets you download videos on iPhone and iPad ? Check out other hidden features in the debug menu, and let us know which is your favorite in the comments below.
Leave a Reply Cancel reply
You must be logged in to post a comment.
This site uses Akismet to reduce spam. Learn how your comment data is processed .
- Mahit Huigol
Design Corral
IOS Safari ā How To Disable Overscroll But Allow Scrollable Divs To Scroll Normally?
As a Mac user, you might have noticed extensions cluttering your Safari browser. They can be useful, but sometimes they aren’t used as often and become more of a burden. Fear not! Disabling or removing extensions from Safari is a breeze. Here’s how:
First, open Safari and click on the Safari menu on the top left corner of your screen. Select “Preferences” and then click on “Extensions” on the top toolbar. Here, you’ll see all the installed extensions on your browser. To disable an extension, uncheck the box next to its name. If you want to remove an extension entirely, click the “Uninstall” button. And voila! No more pesky extensions.
But wait, there’s more! Did you know you can disable scrolling on your iPad Safari? It’s true! Here’s how to do it:
First, open Safari on your iPad and type “apple.com” in the search bar. Next, click on the search bar, and you’ll see a box with the text “apple.com” and a downward arrow to the right. Click on the arrow, and a drop-down menu will appear. Select “Settings for This Website” and you’ll see a variety of toggles. Slide the switch next to “Allow Scrolling” to the left to disable scrolling on that particular website.
But what about iframes that are vertically scrollable and responsive in both iOS and desktop browsers? Fear not, developers! Here’s how to achieve this:
First, insert the iframe into your HTML code with the proper dimensions and source. Then, to allow vertical scrolling, add “scrolling=’yes'” within the iframe tag. To make it responsive, add the following CSS code:
“` iframe width: 100%; height: 0; padding-bottom: (height/width)*100%; overflow: hidden;
iframe iframe position: absolute; top: 0; left: 0; width: 100%; height: 100%; padding-bottom: 0; overflow: auto;
This will allow the iframe to resize proportionally based on the screen size and allow for scrolling within the iframe on iOS and desktop browsers.
But what about horizontal overscroll on iOS with phonegap or not? Is there a way to disable it? You bet there is! Here’s how:
First, add the following CSS code to your webpage:
“` html,body overflow-x: hidden;
This will disable horizontal scrolling on your webpage on all devices, including iOS. But what if you want to keep vertical scrolling enabled? No problem! Simply add the “overflow-y: auto” property to your CSS code to allow vertical scrolling.
And there you have it, folks! Handy tips and tricks for your Safari browser and web development needs. Happy browsing and coding!
Leave a Comment Cancel reply
Save my name, email, and website in this browser for the next time I comment.
Looks like no oneās replied in a while. To start the conversation again, simply ask a new question.
How can I get my scrollbar back in Safari?
My scroll bars keep on disappearing in Safari browser windows and I always have to hit the down key instead of using my Wacom pen or Apple bluetooth mouse to scroll down. When I point my mouse or pen towards the righthand end of the screen the scrollbar never reappears. Is there a way of getting scrollbars to stay up all the time? Its kind of annoying.
Time Capsule-OTHER, OS X Mountain Lion (10.8.2)
Posted on Sep 21, 2012 2:02 AM
Posted on Sep 21, 2012 2:10 AM
Have you visited System Preferences > General > Show Scroll Bars: Set this to "Always".
Loading page content
Page content loaded
Sep 21, 2012 2:10 AM in response to timbloke
Nov 17, 2017 12:35 PM in response to timbloke
I have the System Preference set to Always Show, and Safari still (November 2017) arbitrarily hides the vertical scrollbar. Sometimes multiple command-minus (till text is too small to see) brings it back, and it stays when I restore the font size to something readable. Other times it's a matter of resizing the browser window. This is incredibly annoying.
Feb 25, 2013 5:39 PM in response to SteveKir
Mar 30, 2013 6:07 PM in response to SteveKir
SteveKir wrote: Have you visited System Preferences > General > Show Scroll Bars: Set this to "Always".
Thanks Steve.
Just started working with OS X 10.8 aka Mountain Lion after upgrading from 10.6 (whatever its name was) and have spent most of the time working out how to turn off various animations and autoācorrections and get back scroll bars.
Apr 8, 2013 3:23 PM in response to SteveKir
Hi Steve, I have 10.8 and my scroll bar is missing but I do not have the option in my safari prefrences to add a scroll bar. Is there a way to get it back?
Apr 8, 2013 3:27 PM in response to kimdev
kimdev wrote: Hi Steve, I have 10.8 and my scroll bar is missing but I do not have the option in my safari prefrences to add a scroll bar. Is there a way to get it back? Thanks Kim
It's exactly where Steve said it is in System Preferences, not Safari Preferences.
Apr 9, 2013 3:16 PM in response to SteveKir
I am on Mac OS X and also in Safari browser windows the scroll bar sometimes isn't there, however in System Preferences there isn't a General option, and when I went on Appearance which seems is where the options of scroll bar behaviour are, there were no three options that I could choose Always from. Also when there is no scroll bar in the Safari window nothing happens when I press the arrow keys or space bar so I'm stuck being able to view only the top of the page. Do you know if there is a way around this please?
Apr 9, 2013 3:54 PM in response to anapourva
The very first I on in System Preferences should be General.
Apr 9, 2013 4:29 PM in response to anapourva
anapourva wrote: ... however in System Preferences there isn't a General option, and when I went on Appearance which seems is where the options of scroll bar behaviour are, there were no three options that I could choose Always from.
If You can't find it, click "Show All" in System preferences. It should be the very first item if you have System Preferences "View" option set to "Organize by categories."
If you are stoll having problems finding it, type "scroll" in the search box at the top right of the window, which should highlight every preference pane that involves scrolling, including "Gneral."
If you still can't find it, in the popup list under the search box, choose "Scroll Bar Behavior."
Apr 9, 2013 4:37 PM in response to R C-R
thank you for what you've said i've followed it all yet no success, maybe its just how it is set and I can't get that "always" option
Apr 9, 2013 4:40 PM in response to anapourva
What version of Mac OS are you running?
This is the General tab in System Preferences (not Safari) running 10.8.3:
You can see that I have "show scrollbars always" checked.
Apr 9, 2013 4:48 PM in response to petermac87
the 1st in my system preferences is Appearance under Personal, and it is Organised by Categories under View, as R C - R said hmm
Apr 9, 2013 4:52 PM in response to anapourva
anapourva wrote: the 1st in my system preferences is Appearance under Personal, and it is Organised by Categories under View, as R C - R said hmm
What version of OSX are you running?
Apr 9, 2013 4:57 PM in response to babowa
I'm on 10.6.4, thats probably why? ye I don't have that option of Show scroll bars so I can't choose Always. how do you take a capture of it so I can show?
Apr 9, 2013 5:03 PM in response to petermac87
version 10.6.4
How to disable smooth scrolling when pressing the arrow keys in Safari for Mac
Did you know you can disable smooth scrolling in the Safari browser on your Mac? Doing so lets you scroll pages line by line with the arrow keys on your keyboard.
Apple added support for smooth webpage scrolling to Safari 16.4, which was released for macOS Monterey and Big Sur. This behavior is also present in Safari for macOS Sonoma, the latest Mac operating system.
With some digging, you can revert to scrolling pages line by line when pressing directional arrow keys on the keyboard. For that to happen, you’ll need to tick off a setting in Safari’s hidden Debug menu, as instructed in this tutorial.
How to disable smooth scrolling in Safari for Mac
To stop Safari’s smooth scrolling behavior, you must toggle an option in Safari’s hidden Debug menu. But first, you must reveal the menu if you haven’t already. You can do so through Terminal, but you’ll need to give the Terminal app permission to access the whole file system on your Mac.
1. Enable Full Disk Access for Terminal
Click the Apple menu and choose System Settings , then select Privacy & Security in the sidebar and click Full Disk Access on the right. Next, slide the switch next to Terminal to the ON position. If Terminal isn’t listed, click the + (Add) icon, navigate to the Applications/Utilities folder on your Mac and double click the Terminal app.
If asked, authenticate with Touch ID, your macOS password or your Apple Watch.
2. Reveal Safari’s hidden Debug menu
With that done, we can now turn on Safari’s hidden Debug menu. Open Terminal from the Applications/Utilities folder, paste the following command into the Terminal window and press Return or Enter to execute it:
With the Debug menu turned on in Safari, we can proceed to the final step.
3. Turn smooth scrolling off
Now open Safari , click the Debug menu andĀ select WebKit Internal Features > EventHandler driven smooth keyboard scrolling . Doing so should remove the checkmark from the option, deactivating smooth scrolling.
With smooth scrolling disabled, pressing an arrow key on the keyboard will no longer scroll a page continuously until you release the key. Instead, the page will move one line at a time.
To reactivate smooth scrolling, toggle the Debug menu option to add a checkmark. When done, you can safely hide the Debug menu again with this Terminal command:
Hiding the Debug menu will not change your smooth scrolling setting.
Which scrolling type are you: Smooth or jumpy?
Smooth scrolling isn’t a biggie as long as you don’t use the arrow keys. But if you’re like me and prefer to scroll an article one line or page at a time using the keyboard, you may want to switch back to the good ol’ jumpy scrolling method.
It would’ve been far better had Apple put this toggle in the Safari preferences, so we could change the scrolling type with a simple checkbox instead of digging through hidden menus. Be that as it may, now you at least have the option to change Safari’s scrolling method in case you’re not a fan of smooth scrolling.
Other Safari tutorial to check out
- How to add or remove your credit cards in Safari on iPhone, iPad or Mac
- How to show the full URL in Safari’s address bar on your Mac
- How to download videos from Safari on iPhone and iPad
- How to use profile in Safari for iPhone, iPad and Mac
- How to pin tabs in Safari on iPhone, iPad and Mac
IMAGES
VIDEO
COMMENTS
12. Depending on how your element is positioned / layered using z-index, in addition to hiding the appearance of the scrollbar, you may also need to set the width/height of the scrollbar to 0. Otherwise, the contents that would be contained under the scroll track area may be hidden. .element::-webkit-scrollbar {. -webkit-appearance: none;
Apple you need to give the option to disable it. Apple added this scroll grab function with IOS13. For me it's a nuisance š¤¬. Trying to read a news app or just in Safari I use my right thumb to navigate. It keeps grabbing the scroll bar when I don't want it too. Apple you need to give the option to disable it.
To hide the scrollbar from Chrome, Safari, Edge, and Opera, you can use the pseudo-element selector :-webkit-scrollbar and set the display property to none. Here's the CSS syntax: body::-webkit-scrollbar { display: none; } To hide the scrollbar from Firefox, you need to add the scrollbar-width:none property to the html tag as follows:
window.scrollTo(0, scrollY); } There we go! š . Try it out on iOS Safari 15 by clicking the "Open modal" button below. It's been tested with the address bar at the bottom of the viewport (which is the default) and at the top. We can move it to the top by tapping "aA" and then "Show Top Address Bar".
In this example, we'll focus on how to hide the scrollbar without affecting the ability to scroll: .scrollable-content { height: 150px; } .scrollable-content::-webkit-scrollbar { display: none; } As you can see in the above demo, the scrollbar is hidden, but the page remains scrollable using both the mouse and keyboard.
Example. body {. overflow-y: hidden; /* Hide vertical scrollbar */. overflow-x: hidden; /* Hide horizontal scrollbar */. } Try it Yourself Ā». Note that overflow: hidden will also remove the functionality of the scrollbar. It is not possible to scroll inside the page. Tip: To learn more about the overflow property, go to our CSS Overflow ...
The CSS property overflow-x: hidden is used to hide the horizontal scrollbar on an element. This property also affects the element's ability to scroll on its horizontal axis. You can hide a scrollbar on an element while being given the ability to scroll, through the following: A pseudo selector ::-webkit-scrollbar, which is only supported for ...
Click the Apple logo and go to "System Settingsā¦" menu. Open Mac System Settings. Go to "Appearance" section and then scroll down to the bottom on the settings page. Select your preference under "Show scroll bars" section. Scroll Bar Setting in macOS Ventura or Sonoma. Similarly, you can setup the scrolling direction from ...
Since the last security update on Safari, often when I use the back arrow to return to a previous page, the scroll bar disappears. I have checked System Preferences and the 'always show scroll bar' option is selected. I'm using macOS Monterey version 12.7.1 and Safari version 17.1. Thanks.
Workarounds: 1. Open in a new tab or window. Control-click a page summary in the Reading List sidebar, then choose either Open in New Tab or Open in New Window. 2. Use the keyboard or scroll bars for webpage navigation. Use of either method with prevent transition to the next Reading List page.
Let us use this method to turn off smooth scrolling on Mac. Quit Terminal and open Safari. Select Debug>Webkit Internal Features> EventHandlerdriven smooth keyboard scrolling from the debug menu ...
First, open Safari and click on the Safari menu on the top left corner of your screen. Select "Preferences" and then click on "Extensions" on the top toolbar. Here, you'll see all the installed extensions on your browser. To disable an extension, uncheck the box next to its name. If you want to remove an extension entirely, click the ...
If you are stoll having problems finding it, type "scroll" in the search box at the top right of the window, which should highlight every preference pane that involves scrolling, including "Gneral." If you still can't find it, in the popup list under the search box, choose "Scroll Bar Behavior." anapourva.
Go to System Preferences. Click on the General icon. Look for the Show scroll bars section. Choose Always. Click on the red dot on the upper left corner of the window to save your preferences. That's it! Taking these steps should stop your scroll bars from disappearing, even when you take your time when reading a document.
3. Turn smooth scrolling off. This is how you disable smooth scrolling | Image: Christian Zibreg/iDB. Now open Safari, click the Debug menu and select WebKit Internal Features > EventHandler driven smooth keyboard scrolling. Doing so should remove the checkmark from the option, deactivating smooth scrolling.
Horizontal scroll you could even disable it with just css, applying overflow-x:hidden; to your main container. I noticed in the latest versions of safari you cannot disable the bounce effect though. It's a native feature of the browser on mobile devices. -
Obviously you will need to change the properties to suite what you want. Again this is for Safari as overflow-y: scroll; does not force it to show. If you want to assign this to a scrollbar on a specific element, you can add any css selector before: .mydiv::-webkit-scrollbar {. -webkit-appearance: none; width: 8px; }
Bohdan's solution above is great. However, it doesn't catch/block the momentum-- i.e. the case when user is not at the exact top of the page, but near the top of the page (say, scrollTop being 5px) and all of a sudden the user does a sudden massive pull down! Bohand's solution catches the touchmove events, but since -webkit-overflow-scrolling is momentum based, the momentum itself can cause ...
The appearance of the scroll bars can be controlled with WebKit's -webkit-scrollbar pseudo-elements [].You can disable the default appearance and behaviour by setting -webkit-appearance [] to none.. Because you're removing the default style, you'll also need to specify the style yourself or the scroll bar will never show up.