text field margins in IE

They have: 447 posts

Joined: Oct 1999

I've tried just about everything i can think of and i can't get rid of a 1px margin IE adds to input fields.

http://www.rob-johnson.net/test/test/test.html

It works like a charm in moz browsers, havnt tried opera, but i can't for the life of me get the text field to align at the top of the div in IE 5 or 6.

Any ideas?

edit: and for clarity because it's not immediately obvious, the text field is the same height as the div (24px), the text field just has a background which makes it appear smaller (http://www.rob-johnson.net/test/test/navmenu_location_bg.png) -- see the stylesheet

He has: 176 posts

Joined: Oct 1999

What happens if you try specifying no borders using CSS?

.textfield {
  border-top: 0px;
  border-right: 0px;
  border-bottom: 0px;
  border-left: 0px;
}
'

They have: 447 posts

Joined: Oct 1999

doesn't help.

I sort of fixed this with a crude hack and printing browser specific code depending on the UA. I'd still like to know why this doesnt work.

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

Form elements have their own defaults that are browser or even OS specific that you cannot override. That's just the way they are.

Notably, I don't think you should try to fake it like you're doing. Messing with the UI isn't a good design choice.

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.