小编lea*_*php的帖子

我们可以改变<input type ="file">样式吗?

我试图更改HTML表单,输入类型文件.这是我的代码:

HTML,表单id =表单

<input class="upload_file" type="file" id="file" name="file" />
Run Code Online (Sandbox Code Playgroud)

.CSS

I tried both:
.upload_button{
  background: url('../images/upload_btn_bg.png') no-repeat;
  width: 200px; 
  height: 40px;
}

#form input[type=file]{
  background: url('../images/upload_btn_bg.png') no-repeat;
  width: 200px; 
  height: 40px;
}
Run Code Online (Sandbox Code Playgroud)

这两种方法都不起作用.我确实从一些网站上看到,比如facebook,youtube,google或twitter,它们有不同的风格.不知道他们是怎么做到的.

css

17
推荐指数
4
解决办法
4万
查看次数

标签 统计

css ×1