我一直在尝试实现拖放输入文件的跨浏览器功能,我已经非常接近了,但最后一件事我不太清楚。正如标题所说,它在 Chrome/IE 中工作得很好,但在 Firefox 中却表现不一样。为简单起见,我在我的 fiddle 中省略了拖放功能,因为它与问题无关。
<div class='browseWrapper'>
Drag & Drop Images Here</br><em>Or click to browse.</em>
<input class='browseImage' type='file' />
</div>
这是我目前得到的:http://jsfiddle.net/sPJ9u/
提前致谢。
编辑:抱歉,我应该更清楚地解释这个问题。如果您检查 firefox 中的输入元素,您会发现 overflow:hidden 没有像在 Chrome/IE 中那样 overflow hidden ,导致偏移量超出范围。
Firefox 版本:26
最佳答案
查看此相关问题:Why does overflow:hidden not work in a <td>?
这是因为您将 display 设置为 table-cell,这使得它的行为就好像 div 实际上是一个 td。
关于html - Firefox 溢出 :hidden not working as it does in Chrome/IE,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20705397/