2

i want to set the width of the html tag . And also apply css on the browse button which is provided in the input type file.

I referred the following -

Is there a way to set width of for showing in Firefox?

also referred following-

Setting uniform width in all browsers

but it is for specific browser. It should work on the mozila firefox , netscape navigator, google crome,safari etc. and i don't want to hide the original input control.

how to do this?

1

2 Answers 2

1

The short answer is that you can not really style the input file, and it's like this by design. how ever, some tricks are available for you, for example: http://www.quirksmode.org/dom/inputfile.html

Sign up to request clarification or add additional context in comments.

Comments

1

You don't. It doesn't work that way.

You can specify the size of the element, but the browser chooses itself how to use that space to display the input field and the button. You can't style the intput field and the button separately.

It's not even specified in the standard that the file input should have an input box and a button. The browser can display the control any way it sees fit, and some browsers displays it differently, for example using a button and a text label.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.