Inputfile Custom button beautification (DEMO) _ HTML/Xhtml _ webpage Creation

Source: Internet
Author: User
If you do not want to see the path, only display the Custom button, and use another method, the following is just implemented using the css technique, here we can see how powerful css is. I have previously written such an article, but I have used js scripts. The advantage is that I can display the file path.

If you do not want to see the path, only display the Custom button, and use another method, the following is just implemented using the css technique.

The key is to assign a font-size to the file field, set a relatively large value, and change the form in uppercase (the appearance of Each browser is different, but the uppercase is changed), for example:

Input {font-size: 100px ;}

Use position positioning and transparency to achieve the desired effect. The Code is as follows:

The Code is as follows:


. FileInputContainer {
Height: 256px;
Background: url (http://files.jb51.net/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;
}


The Code is as follows:





DEMO:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.