Home  >  Article  >  Web Front-end  >  How to disable scroll bar scrolling in css

How to disable scroll bar scrolling in css

青灯夜游
青灯夜游Original
2021-04-30 14:14:1211743browse

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.

How to disable scroll bar scrolling in css

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn