input背景图片设置

html代码:

<input type="file" id="file_btn" src="img.jpg" />

css代码:

input[type="file"]{   
     /* 常规设置, 即:引入一个图片背景,设置在中心位置,大小和按钮的大小一致,以及鼠标指针为手型 */  
         width:40px;   
         height:40px;   
         background:url(img.jpg) no-repeat center;   
         cursor:pointer;  
      /* 下面的不用多问,四句一起拷贝就可以了,大概意思就是把value值设置为0像素,也就是肉眼无法看到,但却又是存在的(用$_POST['submit_btn'] 可以证明)*/ display:block; font-size:0; line-height:0; text-indent:-9999px;
posted @ 2014-10-08 16:42  雷锋很忙灬  阅读(8933)  评论(0编辑  收藏  举报