Set width of native html5 date and time pickers on iOS devices

前端 未结 2 2056
你的背包
你的背包 2021-02-05 05:27

I\'m using the native date and time pickers with type=date and type=time for the mobile version of a website I\'m working on. The input fields are not respecting the css I have,

2条回答
  •  一向
    一向 (楼主)
    2021-02-05 05:38

    To avoid losing any style elements applied to other input boxes, use textfield instead of none.

    .arriveDate, .arriveTime  {
      -webkit-appearance: textfield;
      -moz-appearance: textfield;
    }
    

    Also, if you just want to make all the date fields appear like textboxes but still work like date fields...

    input[type="date"]
    {
        display:block;
        -webkit-appearance: textfield;
        -moz-appearance: textfield;
        min-height: 1.2em;
    }
    

提交回复
热议问题