Add scroll = "no" to <boby> to hide the scroll bar;
Add style = "overflow-x: hidden" to <boby> to hide the horizontal scroll bar. Add style = "overflow-y: hidden" to hide the vertical scroll bar.
1. Completely hidden
Add scroll = "no" to hide the scroll bar;
2. Hide it when it is not needed
When the browser window width or height is greater than the page width or height, no scroll bar is displayed; otherwise, it is displayed;
3. Style sheet method
Add style = "overflow-x: hidden" to hide the horizontal scroll bar;
Add style = "overflow-y: hidden" to hide the vertical scroll bar.
Add to included page
The following is an explanation: body {overflow-x: hidden;} is not allowed in the standard DTD.
Html {overflow: scroll ;}
Force hide the scroll bar:
Html {overflow: hidden ;}
Hide the horizontal scroll bar of IE:
Html {overflow-x: hidden ;}
Hide the vertical scroll bar of IE:
Html {overflow-y: hidden ;}
Forcibly display the horizontal scroll bar of IE:
Html {overflow-x: scroll ;}
Forcibly display the vertical scroll bar of IE:
Html {overflow-y: scroll ;}
Force Display of Mozilla horizontal scroll bar:
Html {overflow:-moz-scrollbars-horizontal ;}
Note: Only the horizontal scroll bar is forcibly displayed. That is to say, even if the vertical scroll bar needs to be displayed, the vertical scroll bar will not appear.
Force Display of Mozilla's vertical scroll bar:
Html {overflow:-moz-scrollbars-vertical ;}
Note: only the vertical scroll bar is displayed. That is to say, the horizontal scroll bar does not appear even if the horizontal scroll bar needs to be displayed.
The final solution:
Add on the page:
The code is as follows: |
Copy code |
<Style> Html {overflow-x: hidden; // hide the horizontal scroll bar overflow-y: hidden; // hide the vertical scroll bar} </Style> |