Rodin83
Invité n'ayant pas de compte PHPfrance
16 juil. 2015, 16:01
Bonjour,
Essayez ceci, mais tu dois remplacer le nom de l'image que tuveux inserer!
<div class="fileUpload">
<span class="custom-span"> <img src="bouton.jpg" height="100" width="100" >
</span>
<p class="custom-para">Ajouter une photo</p>
<input id="uploadBtn" type="file" class="upload" />
</div>
<input id="uploadFile" placeholder="0 files selected" disabled="disabled" />
<script type="text/javascript">
document.getElementById("uploadBtn").onchange = function () {
document.getElementById("uploadFile").value = this.value;
};
</script>
CSS CODE:
.fileUpload {
position: relative;
overflow: hidden;
margin: 10px;
background-color: #BDBDBD;
height: 100px;
width: 100px;
text-align: center;
}
.fileUpload input.upload {
position: absolute;
top: 0;
right: 0;
margin: 0;
padding: 0;
font-size: 20px;
cursor: pointer;
opacity: 0;
filter: alpha(opacity=0);
height: 100%;
text-align: center;
}
.custom-span{ font-family: Arial; font-weight: bold;font-size: 100px; color: #FE57A1}
#uploadFile{border: none;margin-left: 10px; width: 200px;}
.custom-para{font-family: arial;font-weight: bold;font-size: 24px; color:#585858;}