csdn.rar
test.html
和标准的HTML的File控件不一样。
css样式(upload.css)
点击(此处)折叠或打开
- @charset "utf-8";
- a.btn {
- width: 120px;
- height: 42px;
- overflow: hidden;
- display: block;
- text-decoration: none;
- background: url(chose_file.gif) left top no-repeat;
- }
- a.files {
- background-image: url(chose_file.gif);
- }
- /*file设为透明,并覆盖整个触发面*/
- a.files input {
- margin-left: -350px;
- font-size: 30px;
- cursor: pointer;
- filter: alpha(opacity = 0);
- opacity: 0;
- }
- /*取消点击时的虚线框*/
- a.files,a.files input {
- outline: none; /*ff*/
- hide-focus: expression(this.hideFocus = true); /*ie*/
- }
点击(此处)折叠或打开
- link href="upload.css" rel="stylesheet" type="text/css" />
- a href="" class="btn files"> input id="txt_userfile" name="txt_userfile" type="file" onchange="" />