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


基础教程推荐
- Bokeh Div文本对齐 2022-01-01
- npm start 错误与 create-react-app 2022-01-01
- Fabric JS绘制具有活动形状的多边形 2022-01-01
- fetch 是否支持原生多文件上传? 2022-01-01
- 如何添加到目前为止的天数? 2022-01-01
- 在 contenteditable 中精确拖放 2022-01-01
- Bootstrap 模态出现在背景下 2022-01-01
- 检查 HTML5 拖放文件类型 2022-01-01
- 即使用户允许,Gmail 也会隐藏外部电子邮件图片 2022-01-01
- 原生拖动事件后如何获取 mouseup 事件? 2022-01-01