I have been having this problem recently when designing websites. After designing the member center, with the content centered with margin:0 auto;, the webpage will swing to the left the moment it is opened, and then to the right when entering another page, and then swing back to the left. If you jump between pages frequently, you will feel dizzy. The reason is that when the height of the webpage is not enough, the scroll bar on the right will not appear. Here, the width of the webpage must be added to the width of the scroll bar. When margin:0 auto; is used, the webpage is centered, but when the height of the webpage allows the browser to have a scroll bar, the width of the webpage must of course be subtracted from the width of the scroll bar, and then the webpage will swing a little to the left. Otherwise, do you understand what I said above? Many people should have experienced this situation. The solution is very simple, just make the right scroll bar appear all the time in the style sheet (CSS). When the webpage is not high enough, the browser will also make it appear when the right scroll bar appears. The code is: Copy code The code is as follows:html{overflow-y:scroll;} |
<<: This article will show you the basics of JavaScript: deep copy and shallow copy
>>: Detailed tutorial on using Docker to build Gitlab based on CentOS8 system
After entering yum in linux, the prompt: -bash: /...
Install the required environment 1. gcc installat...
Be sure to remember to back up your data, it is p...
This article example shares the specific code of ...
Preface In most projects, you will encounter onli...
Basic concepts of consul Server mode and client m...
<br />The countless information on the Inter...
There are three main ways of MySQL replication: S...
Table of contents Overview 1. Global Registration...
This article shares the specific code of JS to im...
This article example shares the specific code of ...
Phenomenon When using Apache Spark 2.x, you may e...
Table of contents 1. Change the 2375 port of Dock...
1. Introduction to Nginx Nginx is a web server th...
1. Oracle is a large database while MySQL is a sm...