我怎么样式输入文件文本框? [英] how can i style input file textbox?

查看:112
本文介绍了我怎么样式输入文件文本框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用css调整html的输入文件类型,并更改浏览按钮,感谢

How can I style html the input file type using css, and also change the browse button, thanks

推荐答案



您不能。

Short Answer

You can't.

使用 opacity 使您的文件输入不可见,然后创建包含正常文本输入和按钮的假的 div ,将其绝对定位以覆盖实际输入,然后将其z索引设置为低于实际输入。样式的元素。

Make your file input invisible using opacity, then make a fake div that contains a normal text input and a button, position it absolutely so that it covers the real input, then set its z index to be below the real input. Style the elements.

当用户点击文本输入或按钮时,他们实际上会点击透明的实际输入。

When a user clicks on the text input or the button, they will actually be clicking on the real input that is transparent.

工作示例:样式文件输入

Working example: styled file input

这篇关于我怎么样式输入文件文本框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆