gpt4 book ai didi

javascript - Php配置文件上传图片

转载 作者:太空宇宙 更新时间:2023-11-04 07:51:23 25 4
gpt4 key购买 nike

.profile-pic {
position: absolute;
border-radius: 50%;
height: 150px;
width: 150px;
left: 20%;
top: 42%;
background-size: cover;
background-position: center;
background-blend-mode: multiply;
vertical-align: middle;
text-align: center;
color: transparent;
transition: all .3s ease;
text-decoration: none;
cursor: pointer;
}

.profile-pic:hover {
background-color: rgba(0,0,0,.5);
z-index: 10000;
color: #fff;
transition: all .3s ease;
text-decoration: none;
}
.profile-pic span {
display: inline-block;
padding-top: 4.5em;
padding-bottom: 4.5em;
}
<form action="upload.php" method="POST" enctype="multipart/form-data">
<div class="profile-pic" style="background-image: url('https://soygrowers.com/wp-content/uploads/2017/02/default_bio_600x600.jpg')">

<span class="glyphicon glyphicon-camera"></span>
<span>Change Image</span>
</div>
</form>

我正在为用户制作一个个人资料页面,当我点击它时我制作了我的个人资料图片它不会打开图像文件夹。有什么帮助吗?我只想知道我做错了什么。事实上,我以前从未做过这样的事情。

最佳答案

您必须包含文件输入才能选择文件。

<div class="profile-pic" onclick="document.getElementById('selectedFile').click();"> 
<input type="file" id="selectedFile" style="display: none;" />
<span class="glyphicon glyphicon-camera"></span>
<span>Change Image</span>
</div>

关于javascript - Php配置文件上传图片,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47736140/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com