HTML File upload field style(HTML 文件上传字段样式)
问题描述
我正在尝试创建一个有点风格的文件上传字段,但我似乎在查找此类示例时遇到了问题.我知道部分原因是字段本身因浏览器而异.
I am trying to create a file upload field that has a little bit of style to it, but I seem to be having problems finding examples of this. I know part of the reason is that the field itself varies from browser to browser.
任何想法如何做到这一点?或者有没有办法在不使用可以设置样式的表单的文件元素的情况下做到这一点?
Any ideas how to do this? Or is there a way to do this without using a file element of a form that can be styled?
推荐答案
如果您的意思是文件名的文本字段,您可以在 css 文件中使用 input[type=file] 选择器.例如:
If what you mean is the text field for the file names, you can use the input[type=file] selector in the css files. For example :
input[type=file] { background-color: red; }
如果您的意思是文件选择对话框,我认为它取决于浏览器/操作系统,您几乎无能为力(如果有的话).
If what you mean is the file selection dialog box, I think it's browser/OS dependent and there's little (if any) you can do about it.
这篇关于HTML 文件上传字段样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:HTML 文件上传字段样式


- 使用RSelum从网站(报纸档案)中抓取多个网页 2022-09-06
- CSS媒体查询(最大高度)不起作用,但为什么? 2022-01-01
- Css:将嵌套元素定位在父元素边界之外一点 2022-09-07
- Fetch API 如何获取响应体? 2022-01-01
- 失败的 Canvas 360 jquery 插件 2022-01-01
- 400或500级别的HTTP响应 2022-01-01
- Quasar 2+Apollo:错误:找不到ID为默认的Apollo客户端。如果您在组件设置之外,请使用ProvideApolloClient() 2022-01-01
- Flexslider 箭头未正确显示 2022-01-01
- addEventListener 在 IE 11 中不起作用 2022-01-01
- 如何使用 JSON 格式的 jQuery AJAX 从 .cfm 页面输出查 2022-01-01