Html CSS 隐藏 input选择的文件名

<!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>

评论