Home >Web Front-end >CSS Tutorial >How to disable scroll bar scrolling in css
In CSS, you can use the overflow-x and overflow-y attributes to prohibit scroll bar scrolling; add the "overflow-x:hidden" style to the boby element to prohibit horizontal scroll bar scrolling, add "overflow-y :hidden" style disables vertical scrollbar scrolling.
The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.
css prohibits scroll bar scrolling
Set like this:
body{ overflow-y: hidden; overflow-x: hidden; }
The overflow-x attribute specifies whether to clip the left/if it overflows the content area of the element Right margin content.
The overflow-y attribute specifies whether to clip top/bottom edge content if it overflows the element's content area.
When the values of these two properties are set to "hidden", the horizontal and vertical scroll bars can be disabled and scrolling of the scroll bars is prohibited.
(Learning video sharing: css video tutorial)
The above is the detailed content of How to disable scroll bar scrolling in css. For more information, please follow other related articles on the PHP Chinese website!