Does Mini Program use rpx, for all kinds of bug??

The width of

is normal with rpx, but after adding border or padding, rpx will not be able to adapt to various screens. It is not good to use rpx highly. Is it that I use it in the wrong way, or is it that rpx really doesn"t work?

such as the following cases

<view class="page"></view>
.page {
  /* border: 30rpx solid red; */
  padding: 30rpx;
  width:690rpx;
}

whether adding border or padding, to page, only when the screen width is 375px, the width of page is full, and 1px-2px will be lost on any other screen

Mar.02,2021

Wechat officially replied: because the decimal point will inevitably occur in the process of rpx conversion. At this point, there may be an error of 1-2px on the display. If the style requirements are relatively high, it is recommended to use CSS's media-query to make responsive pages.


is suitable for larger screens, while the error for small screens is a bit large.

Menu