收藏
回答

为何组件switch不能更改“宽度”?

<switch>共盘</switch>

问题:switch开关的宽度无法改变!!!无论用什么方法,中间那个圆球的滑动距离,永远是该组件原始的宽度距离!!!!

请助:如何改变switch开关的长度?!

/*以下是wxss代码*/

.wx-switch-input {    

    width: 250rpx !important;

    height: 42rpx !important;

    background: white !important;

    border: #b7b8b9 1rpx solid !important;

    border-radius: 15rpx !important;

}


/********** 《注》《意》《!》这部分代码设置为何无效?:设置了都没有效果!! ************/

.wx-switch-input::before{

    width: 200rpx !important;

    height: 40rpx !important;

    background: red !important;

}

/******************************************************************/


/************** 而正面这个是有效果的 *******************/

.wx-switch-input::after {

    border-radius: 15rpx !important;

    width: 40rpx !important;

    height: 40rpx !important;

    color: white !important;

    background: #f9d100 !important;

    content: "|||" !important;

    font-size: small !important;

    text-align: center;

}


回答关注问题邀请回答
收藏

3 个回答

  • 过去的过去
    过去的过去
    2022-07-25

    都没有办法解决吗?

    2022-07-25
    有用 1
    回复 3
    • 清蒸鱼
      清蒸鱼
      2022-08-25
      同问
      2022-08-25
      回复
    • QIlI
      QIlI
      2022-09-23
      switch {
        zoom: .6;
      }
      2022-09-23
      8
      回复
    • zefan
      zefan
      2023-04-29回复QIlI
      卧槽!好人一生平安(*¯︶¯*)
      2023-04-29
      回复
  • 古枫
    古枫
    2023-01-07

    引个组件就能解决了

    2023-01-07
    有用
    回复
  • 编程大石头
    编程大石头
    2023-01-02

    既然没人解决你的问题那我就收费了:50元告诉你

    2023-01-02
    有用
    回复
登录 后发表内容