热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

Firefox4文件输入宽度错误?-Firefox4fileinputwidthbug?

3ImchangingthewidthofafileinputHTMLtag:3我正在改变文件输入HTML标签的宽度:<inputtypefileidne

3I'm changing the width of a file input HTML tag:

3我正在改变文件输入HTML标签的宽度:


input[type="file"] {width:380px !important}

In Firefox 3, Chrome and Safari it works perfectly.

在Firefox 3,Chrome和Safari中,它可以完美运行。

In Firefox 4 I cant get it to work. The width remain the same!

在Firefox 4中我无法使用它。宽度保持不变!

Demo: http://jsfiddle.net/LwzW9/1/

演示:http://jsfiddle.net/LwzW9/1/

Checking with Firebug I noticed that the size of the changes, but I don't really see the changes: (see image)

使用Firebug进行检查我注意到的大小发生了变化,但我并没有真正看到这些变化:(见图)

enter image description here

Any ideas? Is this a known bug?

有任何想法吗?这是一个已知的错误?

Thanks.

谢谢。

2 个解决方案

#1


13  

I had the same problem when using uniform.js, this kind of solves the problem:

使用uniform.js时我遇到了同样的问题,这种方法解决了这个问题:


or

要么

$('input[type="file"]').attr('size', 'X');

where X is a number of characters that you define. You should also have the correct width in your CSS for safety in other browsers.

其中X是您定义的字符数。为了安全起见,您还应该在CSS中使用正确的宽度。

Fiddle: http://jsfiddle.net/EfntV/

小提琴:http://jsfiddle.net/EfntV/

#2


2  

I notice that you have

我注意到你有

width: 380px !important; //line 94

This would override the value of #newFilename {width:280px}

这将覆盖#newFilename {width:280px}的值

Note I'm not 100% sure about how it works since you're using a much more specific CSS selector to change the width. Would need some sample to look at

注意我不是100%确定它是如何工作的,因为你使用了更具体的CSS选择器来改变宽度。需要一些样本来看


推荐阅读
author-avatar
周笨笨真笨
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有