Html CSS 隐藏 input选择的文件名

首次发布:2021-03-30 11:59
<!doctype html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <title>上传文件</title>
    <style>
        .lqwvje-btn {
            display: inline-block;
            height: 38px;
            line-height: 38px;
            padding: 0 18px;
            background-color: #009688;
            color: #fff;
            white-space: nowrap;
            text-align: center;
            font-size: 14px;
            border: none;
            border-radius: 2px;
            cursor: pointer;
        }
    </style>
</head>

<body>
    <label id="realBtn" class="lqwvje-btn">
        <input type="file" id="testFile" hidden="hidden" >
        上传文件
    </label>
</body>

</html>