首页 > 代码库 > 原来样式改变不了(input type="file")

原来样式改变不了(input type="file")

<style>label { background-color: #979fa8; color: #fff; display: inline-block; padding: .8rem 4rem; cursor: pointer; margin-bottom: 1rem; position: relative; overflow: hidden; text-align: center } span { cursor: pointer } input[type="file"] { display: none; visibility: hidden }</style>

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title></title>
  <style type="text/css">
  label{
    border-radius: .4rem;
    background-color: #979fa8;
    color: #fff;
    display: inline-block;
    padding: .8rem 4rem;
    cursor: pointer;
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
    text-align: center;
    transition: background-color .5s cubic-bezier(.24,.68,.67,.9);
  }
  span{
        cursor: pointer;
    pointer-events: none;
  }
  input[type=file] {
    display: none;
    visibility: hidden;
  }
  </style>


</head>
<body>
<label>
  <span>上传</span>
  <input type="file">


</label>
</body>
</html>

  

原来样式改变不了(input type="file")