Form text input size varies with browsers

greg's picture

He has: 1,581 posts

Joined: Nov 2005

Is there any way to get a html text input the same length in all main browsers?

I've tried setting a font size, HTML size= and even played with percentages in HTML and CSS.

Some cross browser stuff is annoying, but this just takes the biscuit!
And oddly, FF and IE play nicely together, it's Safari that strays off the path.
Doesn't matter what I try to set the text input size it seems to be longer in Safari.

Megan's picture

She has: 11,421 posts

Joined: Jun 1999

Have you tried setting a width in CSS?

Opera always seems to be a bit shorter, I think...

greg's picture

He has: 1,581 posts

Joined: Nov 2005

Setting a width to the input in CSS did solve it.
All are now the same length.

Cheers Megan.

He has: 629 posts

Joined: May 2007

FWIW - Due to the way fonts are displayed on all Mac applications, and Safari on Windows, you'll find lines of text a little longer compared to other Windows applications and browsers.

This *may* be an explanation.

Cordially, David
--
delete from internet where user_agent="MSIE" and version < 8;

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.