Thursday, December 11, 2008

Button Width in IE

Ever been annoyed with extra padding in a input button in Internet Explorer?

However, as it turns out, that fix doesn't work so well when the button is inside a table cell. Here is an image of the problem (table cell in red) and a workaround for that.

The workaround is to use width:1; by default and feed IE a different value (width:auto;) using a conditional comment. It actually works pretty well.



http://jehiah.cz/archive/button-width-in-ie-revised

1 comment:

Elad Meidar said...

Too bad that CSS expression SUCK when looking from a scaling point of view, and that there is no real reason why to put a button inside a table, unless the table is used for layout and that is a really bad idea.