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
HTML provides five space entities with different ...
Communication between containers 1. Network shari...
There are two types of dead link formats defined b...
This article uses examples to illustrate the prin...
Let's look at the code first: ALTER TABLE rep...
Three times of memorization allows you to remembe...
Table of contents 1. Check whether the docker env...
1. A container is an independently running applic...
When Docker creates a container, it uses the brid...
Preface When I was typing my own personal blog, I...
In the field of data analysis, database is our go...
Table of contents background LIMIT Optimization O...
Table of contents 1. Why is JavaScript single-thr...
This article is mainly for those who do not under...
1. First install the pagoda Installation requirem...