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 文件上传字段样式


基础教程推荐
- 如何使用JIT在顺风css中使用布局变体? 2022-01-01
- 我可以在浏览器中与Babel一起使用ES模块,而不捆绑我的代码吗? 2022-01-01
- html表格如何通过更改悬停边框来突出显示列? 2022-01-01
- Chart.js 在线性图表上拖动点 2022-01-01
- 如何使用TypeScrip将固定承诺数组中的项设置为可选 2022-01-01
- 自定义 XMLHttpRequest.prototype.open 2022-01-01
- 用于 Twitter 小部件宽度的 HTML/CSS 2022-01-01
- Electron 将 Node.js 和 Chromium 上下文结合起来意味着 2022-01-01
- 直接将值设置为滑块 2022-01-01
- Vue 3 – <过渡>渲染不能动画的非元素根节点 2022-01-01