IE requires double click with custom button

前端 未结 6 1162
刺人心
刺人心 2021-02-07 13:50

I have a script that is dived as:

HTML:

Cl
6条回答
  •  盖世英雄少女心
    2021-02-07 14:07

    I mixed various solutions to get this one that works for me (on every browser). It's written using LESS nesting.

    HTML

    
    
    Select image

    LESS CSS

    /*
    * Input "file" type Styling
    * Based on http://goo.gl/07sCBA
    * and http://stackoverflow.com/a/21092148/1252920
    */
    .input-file {
      position: relative;
      overflow: hidden;
      margin: 10px;
    
      input[type="file"] {
        opacity: 0;
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        margin: 0;
        padding: 0;
        cursor: pointer;
        width: 100%;
        height: 100%;
        font-size: 10000px;
      }
    
      // For Chrome
      input[type=file]::-webkit-file-upload-button {
        cursor: pointer;
      }
    }
    

提交回复
热议问题