首页 > 其他 > 详细

input背景图片设置

时间:2014-10-08 23:10:47      阅读:310      评论:0      收藏:0      [点我收藏+]

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;

input背景图片设置

原文:http://www.cnblogs.com/leifeng-hm/p/4011531.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!