to hide the scroll bars; 2. Set "" to hide the scroll bars when not needed; 3. Hide the scroll bar through the overflow attribute."/> to hide the scroll bars; 2. Set "" to hide the scroll bars when not needed; 3. Hide the scroll bar through the overflow attribute.">

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

How to disable scroll bars in css

藏色散人
藏色散人Original
2021-04-02 11:29:046161browse

How to disable scroll bars in css: 1. Add "scroll="no"" to to hide the scroll bars; 2. Set "<boby scroll="auto">" to hide the scroll bars when not needed ;3. Hide the scroll bar through the overflow attribute.

How to disable scroll bars in css

The operating environment of this article: Windows7 system, HTML5&&CSS3 version, DELL G3 computer

CSS disable scroll bar

CSS disables scroll bars. There are 4 methods, as follows:

1. Completely hide

Add scroll="no" in d9f058346999e1080c17c8a8369de063 , the scroll bar can be hidden;

<boby scroll="no">

2. Hide when not needed

means that when the width or height of the browser window is greater than the width or height of the page, the scroll bar will not be displayed;

Otherwise, it will be displayed;

<boby scroll="auto">

3. Style sheet method (this is easier to use)

Add style="overflow-x:hidden" to d9f058346999e1080c17c8a8369de063, you can Hide the horizontal scroll bar;

Add style="overflow-y:hidden" to hide the vertical scroll bar.

Add

<style>
html { overflow-x:hidden; }
</style>

4 to the included page 4. Another method

<style type="text/css">
body {
overflow-x:hidden;
overflow-y:hidden;
}
</style>
<style type="text/css">
html {
overflow-x:hidden;
overflow-y:hidden;
}
</style>

Recommended learning: "css video tutorial"

The above is the detailed content of How to disable scroll bars 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
Previous article:How to set css opacityNext article:How to set css opacity