php - 单击图像/按钮时如何触发文件浏览

标签 php javascript html

当我单击自定义按钮时,我想触发浏览器文件上传窗口。它应该显示与下图中相同的内容。 enter image description here

最佳答案

看这里:Custom file input can’t be that hard?

或者你可以尝试这样的事情:

<div style='width:140px;margin-top:80px;position:relative;'>
    <div style='position:absolute; cursor:pointer; cursor:hand; width:140px; height:20px; background:#3172a0; border-top:solid 1px #a2a2a2; color:#fff;padding-top:4px;' align='center'>Browse...</div>
        <input name='image' type='file' size='5' style='position:absolute; cursor:pointer; cursor:hand; height:25px; opacity:0.01; filter:alpha(opacity=0); top:0px; left:0px;' />
    </div>
</div>

关于php - 单击图像/按钮时如何触发文件浏览,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4816543/

相关文章:

php - 将 CSV 文件导入 Postgre

php - 重定向功能在 codeigniter 中不起作用

php - for循环中的JQuery ajax函数表现得很奇怪

html - 去除除链接之外的所有 HTML 标签

php - 在 PHP 中访问 HTML 无序列表元素

html - 表格和 div 宽度之间的差异

javascript - 单击功能更改具有相同类名的所有元素

php - 插入查询不适用于 phpexcel 脚本

javascript - javascript中的正则表达式获取以特定字符串开头的数组的所有字段

javascript - 将居中图像缩放到浏览器窗口