5 replies [Last post]
pingu
pingu's picture
Offline
Enthusiast
UK
Last seen: 7 years 44 weeks ago
UK
Timezone: GMT+1
Joined: 2006-07-24
Posts: 63
Points: 5

hi, why are my file inputs (bottom of page) a different width to my text inputs in firefox 2 for mac? http://www.reapfuels.co.uk/
And how can i make them the same width?

Thanks

Chris..S
Chris..S's picture
Offline
Moderator
Last seen: 9 years 41 weeks ago
Timezone: GMT+1
Joined: 2005-02-22
Posts: 6078
Points: 173

Why? Because the file

Why?

Because the file inputs are using the size=30 and the others are using your .txt width.

How?

Don't set a width for input.txt. Let the browser use size=30 to determine their width. This will set the input portion of the controls to be the same length in Firefox. The browse button for the file control will require more room. I'm not sure how things will work in other browsers.

Form controls can be notoriously difficult to style, in particular, file input, select & radio buttons and checkboxes. Its better to work out how they appear normally and ensure your designer is aware of the restrictions so they can incorporate the standard appearance in their design.

pingu
pingu's picture
Offline
Enthusiast
UK
Last seen: 7 years 44 weeks ago
UK
Timezone: GMT+1
Joined: 2006-07-24
Posts: 63
Points: 5

Thank you very much.

Thank you very much.

pingu
pingu's picture
Offline
Enthusiast
UK
Last seen: 7 years 44 weeks ago
UK
Timezone: GMT+1
Joined: 2006-07-24
Posts: 63
Points: 5

Just to clarify, you cant

Just to clarify, you cant set a file inputs width using css? other inputs you can, but file inputs are the exception?

Chris..S
Chris..S's picture
Offline
Moderator
Last seen: 9 years 41 weeks ago
Timezone: GMT+1
Joined: 2005-02-22
Posts: 6078
Points: 173

You can't in Firefox/Mac. I

You can't in Firefox/Mac. I can't say for other browsers. Your best bet is to produce a test page where you attempt to set the width, set the size, set both and set none and review that page in as many browsers as you can. Or if you're lucky find a web page where someone has already done it and is proud to maintain the results.

pingu
pingu's picture
Offline
Enthusiast
UK
Last seen: 7 years 44 weeks ago
UK
Timezone: GMT+1
Joined: 2006-07-24
Posts: 63
Points: 5

Thanks

Thanks