Making up down arrow of HTML's input number much bigger and cleaner

前端 未结 3 643
遥遥无期
遥遥无期 2021-01-04 11:21

Rather than Is it possible to always show up/down arrows for input "number"?, I want to be able to make up/down arrow much bigger and cleaner.

What I have

3条回答
  •  囚心锁ツ
    2021-01-04 12:08

    you can wrap a input in and element and style it

    div {
      display: inline-block;
      position: Relative;
      border: 2px solid grey;
      border-radius: 10px;
      overflow: hidden;
      -webkit-touch-callout: none;
      -webkit-user-select: none;
      -khtml-user-select: none;
      -moz-user-select: none;
      -ms-user-select: none;
      user-select: none;
    }
    div:before,
    div:after {
      background: white;
      right: 0px;
      width: 30px;
      height: 20%;
      position: absolute;
      pointer-events: none;
    }
    div:before {
      content: '';
      bottom: 50%;
      background: url(http://cdn.flaticon.com/png/256/22205.png) no-repeat white;
      background-size: 20px;
      background-position: center;
    }
    div:after {
      content: '';
      top: 50%;
      background: url(http://cdn.flaticon.com/png/256/22205.png) no-repeat white;
      background-size: 20px;
      transform: rotate(180deg);
      background-position: center;
    }
    input {
      height: 80PX;
      font-size: 50px;
      outline: 0;
      border: 0;
    }

提交回复
热议问题