Text being different sizes in different browsers
I’m sure someone’s had this problem before but I can’t figure it out because I guess I just don’t know enough.
I have a form. One of the inputs has some JS attached so that as the user types (keyup), a
div elsewhere on the page updates with what they’re typing. e.g. They type “hello” and it appears in a
I don’t want the
div which updates to get any bigger than 900px wide and only one text line high.
At the minute I have the
div with overflow hidden so any extra text just disappears, also I have the
maxlength of the
input set so it can’t get too big. However, since different browsers space text differently, in some browsers it’ll allow (for example) 10 words, in others it’ll allow 11.
I have done the css reset thing which is meant to get all browsers acting the same but the spacing of text doesn’t seem too affected.
Is my only option trying to use css to make the spacing between characters the same accross browsers?
Can anyone suggest any alternatives?
here’s the css reset I’m using:
The font I’m using is Arial 32px
One Solution collect form web for “Text being different sizes in different browsers”
Your CSS reset is a pretty poor one. It fixes a lot of display problems but down not address text sizing at all, so it’s useless for this issue. You can find a more comprehensive one here, but changing your reset page may have unintended effects. I’ll suggest using some inspection tools to check if you have padding or margin shrinking the available size to write text in, and if not then setting all aspects of the text so that it is rendered consistently.