Resize the input type=“file” browse button in firefox?

后端 未结 6 1035
庸人自扰
庸人自扰 2021-02-08 00:19

Is there anyway using CSS or JS that you can resize the input type=\"file\" Browse button in firefox?

I know you cannot change the text of the button but all I need to d

6条回答
  •  花落未央
    2021-02-08 01:10

    Edit: As others have noted firefox does not suuport the method below I would refer to the following link http://www.quirksmode.org/dom/inputfile.html

    The following is a pretty simple solution. I would advise adding a class to the label though. Basically you style the label instead of the input avoiding cross browser issues and width and height bugs:

    
    

    CSS

    label input{-moz-opacity:0 ;filter:alpha(opacity: 0);opacity: 0;}
    label {background:green;width:200px;height:100px;display:block; /* more styles here */}
    

    http://jsfiddle.net/DVLxp/

提交回复
热议问题