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

How to disable scroll bar scrolling in css

青灯夜游
Release: 2023-01-05 16:13:15
Original
11801 people have browsed it

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;
}
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template