• 微信小程序的button按钮设置宽度无效


    方法1.

    样式中加入!important,即: 100% !important;

    wxss代码示例

    1
    2
    3
    4
    5
    6
    7
    8
    9
    .login-btn {
        font-size16px;
        width100% !important;
        font-weight400;
        color#fff;
        border-radius: 4px;
        border:1px solid rgba(254,50,50,1);
        background:linear-gradient(180deg,rgba(241,94,94,10%,rgba(222,62,62,1100%);
    }

      wxml代码示例:

    1
    <button class="login-btn" bindclick="login">登录</button>

     效果如下图

    方法2.

    标签内,使用style

    wxml代码示例:

    1
    <button class="login-btn" bindclick="login" style="100%">登录</button>

      

    方法3.

    删除app.json的配置"style": "v2",不过这个不推荐

  • 相关阅读:
    17111 Football team
    Train Problem I (HDU 100题纪念)
    迷宫问题
    图形点扫描
    看病要排队(stl)
    水果
    Prime Ring Problem
    N皇后问题
    2^x mod n = 1
    Queuing
  • 原文地址:https://www.cnblogs.com/fightjianxian/p/13786328.html
Copyright © 2020-2023  润新知