Front-end rookie, I can only understand and copy the code at present. Because the participation of a project needs to use this style, so the example found on the Internet. It is also convenient for you to check it.
/*define image and size*/. Imagefileinput{width:200px;Height:200px;position:Absolute;Background-color:Red;/*Here you can switch to the picture path (background-image:. /img/.... Note the picture path*/}/*defining uploads*/. FileInput{Height:100%;position:Absolute; Right:0;Top:0;Opacity:0;}
Here is the HTML section:
<!DOCTYPE HTML><HTMLLang= "en"><Head> <MetaCharSet= "UTF-8"> <title>CSS style: Click on the image to upload the file</title> <!--Introduce Styles - <Linkrel= "stylesheet"type= "Text/css"href= "Css/style.css"></Head><Body><Divclass= "Imagefileinput"> <inputclass= "FileInput"type= "File"ID=""name=""></Div></Body></HTML>
CSS: Click on the image area to upload files