I have written such an article before, but I used a js script, which has the advantage of being able to display the file path. If you don't want to see the path and only display the custom button, there is another way. The following just uses CSS techniques to achieve it. The key is to give the file field a font-size, set a relatively large value, so that the capitalization of the form changes (the appearance is different in each browser, but the capitalization has changed) as shown below: input{font-size:100px;} Then use position and transparency to achieve the effect you want. The specific code is as follows: Copy code The code is as follows:.fileInputContainer{ height:256px; background:url(//img.jbzj.com/file_images/article/201212/2012122514125641.png); position:relative; width: 256px; } .fileInput{ height:256px; overflow: hidden; font-size: 300px; position:absolute; right:0; top:0; opacity: 0; filter:alpha(opacity=0); cursor:pointer; } Copy code The code is as follows:<div class="fileInputContainer"> <input class="fileInput" type="file" name="" id="" /> </div> DEMO: |
<<: How to solve the problem of too many open files in Linux
>>: Implementation process of the magnifying glass effect in the Javascript example project
transform:scale() can achieve proportional zoomin...
background: Tablespace: All INNODB data is stored...
Get the mongo image sudo docker pull mongo Run th...
Table of contents 1. Installation 2. Import into ...
Table of contents Preface What are dynamic proper...
Table of contents Manual deployment 1. Create a s...
This article example shares the specific code for...
I'm working on electronic archives recently, ...
The layout of text has some formatting requiremen...
In the previous article, after configuring the we...
This article shares the specific code of Javascri...
An application of CSS animation, with the same co...
Hello everyone, I am Qiufeng. Recently, WeChat ha...
Automated build means using Docker Hub to connect...
1 Get the installation resource package mysql-8.0...