CSS custom file Upload button style, compatible with mainstream browser

Source: Internet
Author: User

1. [Code][html] Code
1 <Divclass= "box">2      <inputtype= "text"name= "CopyFile"class= "TextBox" />3      <ahref= "javascript:void (0);"class= "link">Browse</a>4      <inputtype= "File"class= "UploadFile"name= "Upload"5 onchange= "GetFile (this, ' CopyFile ')" />6 </Div>
2. [Code][CSS] Code
1 <styletype= "Text/css">2     * {3 margin:0;4 padding:0;5     }6 Body{7 Font:14px Verdana, Arial, Geneva, Sans-serif;8 Color:#404040;9 background:#fff;Ten     } One img{ A Border-style:None; -     } - . Main{ the width:300px; - Height:60px; - position:Absolute; -  Left:50%; + Top:50%; - Margin-left:-150px; + Margin-top:-30px; A     } at . Box{ - position:relative; - float: Left; -     } - Input.uploadfile{ - position:Absolute; in  Right:0px; - Top:0px; to Opacity:0; + Filter:Alpha (opacity=0); - cursor:Pointer; the width:276px; * Height:36px; $ Overflow:Hidden;Panax Notoginseng     } - Input.textbox{ the float: Left; + padding:5px; A Color:#999; the Height:24px; + Line-height:24px; - Border:1px #ccc Solid; $ width:200px; $ Margin-right:4px; -     } - A.link{ the float: Left; - Display:Inline-block;Wuyi padding:4px 16px; the Color:#fff; - Font:14px "Microsoft Yahei", Verdana, Geneva, Sans-serif; Wu cursor:Pointer; - Background-color:#0099ff; About Line-height:28px; $ text-decoration:None; -     } - </style>

CSS custom file Upload button style, compatible with mainstream browser

Related Article

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.