Home > WeChat Applet > Mini Program Development > What should I do if the button width setting in the WeChat applet is invalid?

What should I do if the button width setting in the WeChat applet is invalid?

王林
Release: 2021-03-12 10:05:22
forward
4024 people have browsed it

What should I do if the button width setting in the WeChat applet is invalid?

Preface:

I don’t know if you have ever encountered such a problem. Setting the width of the button button in the applet has no effect. If you often encounter this problem, then take a look at the solutions below.

Method 1: (Recommended) Write inline styles directly on the button button

wxml code example:

  <button type="primary" style="width:100%">按钮</button>
Copy after login

What should I do if the button width setting in the WeChat applet is invalid?

Method 2: Delete the configuration "style": "v2" in app.json

After configuring "style": "v2" in app.json, you can enable the new version of the component style. Emmm, it exists for a reason. It's okay. We won’t touch it anymore and recommend you to use method one.

(Learning video sharing: php video tutorial)

wxml code example:

<button type="primary">按钮</button>
Copy after login

wxss code example

button{
  width: 100%;
}
Copy after login

What should I do if the button width setting in the WeChat applet is invalid?

Related recommendations: 小program development tutorial

The above is the detailed content of What should I do if the button width setting in the WeChat applet is invalid?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:csdn.net
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template