When uniapp css uses margin, it causes a vertical scroll bar problem

At first, I didn't know what was going on. The page hadn't reached the bottom yet, so why did the vertical scroll bar appear. The reason here is that this happens when the outermost or outermost view uses margin. Changing to padding will not. This is the simplest reason, you can try the following structure, it must be triggered, the trigger condition is very simple.

The general structure is as follows:

.container {
    
    

  .header {
    
    
    
  }

  .main {
    
    
     padding: 20rpx 30rpx 30rpx;
   }

  .card-basic {
    
    }

  .card-perms {
    
    }


  }

}

Guess you like

Origin blog.csdn.net/ScottePerk/article/details/131409142