如何设置输入文件文本框的样式? [英] How can I style input file textbox?

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

问题描述

如何使用 css 为输入文件类型设置 html 样式,并更改浏览按钮,谢谢

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

推荐答案

简答

你不能.

使用 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.

工作示例:样式文件输入

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

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