我是靠谱客的博主 壮观店员,这篇文章主要介绍input中type=“file“设置自定义文件按钮点击,现在分享给大家,希望可以做个参考。

原理z-index覆盖
在这里插入图片描述

<div class="uploadInputsStyle">
                    <input type="text" id="resumeNameId">
                </div>
                <div class="uploadFileStyle" id="uploadFileId">
                    <input type="file" name="resume" id="resume" class="resumeStyle">
                    <div class="uploadStyle"><span>本地上传</span><i class="iconfont uploadIcon">&#xe625;</i></div>
                </div>
.uploadFileStyle {
    position: relative;
    width: 100%;
    height: 60px;
    text-align: center;
    cursor: pointer;
}

.resumeStyle {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: 999;
    opacity: 0;
    cursor: pointer;
}

.uploadStyle {
    position: absolute;
    width: 100%;
    height: 100%;
    padding-top: 20px;
    text-align: center;
}

.uploadStyle span {
    font-size: 20px;
    color: rgba(0, 0, 0, 0.29);
}

.uploadIcon {
    font-size: 20px;
    color: rgba(0, 0, 0, 0.29);
}

最后

以上就是壮观店员最近收集整理的关于input中type=“file“设置自定义文件按钮点击的全部内容,更多相关input中type=“file“设置自定义文件按钮点击内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(94)

评论列表共有 0 条评论

立即
投稿
返回
顶部