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 文件上传字段样式
基础教程推荐
- jQuery File Upload - 如何识别所有文件何时上传 2022-01-01
- Node.js 有没有好的索引/搜索引擎? 2022-01-01
- 如何使用 CSS 显示和隐藏 div? 2022-01-01
- WatchKit 支持 html 吗?有没有像 UIWebview 这样的控制器? 2022-01-01
- 每次设置弹出窗口的焦点 2022-01-01
- 如何使用sencha Touch2在单页中显示列表和其他标签 2022-01-01
- 为什么我在 Vue.js 中得到 ERR_CONNECTION_TIMED_OUT? 2022-01-01
- 如何在特定日期之前获取消息? 2022-01-01
- 什么是不使用 jQuery 的经验技术原因? 2022-01-01
- Javascript 在多个元素上单击事件侦听器并获取目标 2022-01-01
