Forum Moderators: not2easy
The browser must calculate this extra space on a percentage basis, because as the submit button text grows, so does the space.
Does anyone know of a way to control/prevent this? I am able to control other values, such as css padding, but this extra space issue eludes me.
To see what I mean, create a submit button and assign a value of 'me'. Take note of the space to the left and right of 'me'. Now change 'me' to 'the quick brown fox jumped over the lazy cat', then look at the extra space.
The problem is that the calculation is not linear. Unfortunately this means that the actual space added (in pixels) varies from font to font. It also varies from one size to another. On top of that, it varies from one amount of charactes to the other.
AFAIK there's no way of controlling this. Your only option is to explicitly set the width, but then you risk getting some characters cut off if the user changes the font size.
that is what i did to start with, but this turned into too many images. i'm trying to adopt a more standards-based approach, and shed as many images as possible, thereby lightening the load.
monkeesage:
thanks for the link. good info there. i knew i wasn't the first one to run across this...
It's also great to see I'm not the only one seeing that the way browsers render buttons is plain dumb. No one wants that extra space and what purpose does it serve?
Using images is not a great solution, either. It means another image to deal with and place "just so" in every browser and when your button sizes vary - meaning that out of 100 buttons, maybe only 2 are the same width (the text is different for every single button) that's also a lot of work.
This one baffles me - I'd love to know the "why" of the way browser people do their size calculations. It simply makes no sense. Why increase padding with more text, why not allow us to set a margin or padding like nearly every other element? Anyone here work for Microsoft?
Shadows Papa