Viewing Category: CSS  [clear category selection]

Button width fix for IE

I originally saw this on MXNA. Jehiah Czebotar came up with a pretty good solution for making submit buttons or input type="button" elements only be as wide as they need to be. His blog entry. I did a slight modification for inclusion in a style sheet, and all seemed to work fine.

.button{
margin:0;padding:0 .25em;width:auto;overflow:visible;
<!--[if IE]>
width:1;
<![endif]-->
}

Good stuff. This beats the heck of my way of just putting a style="width:XXpx;" on every submit button. It seems to work in IE 6, Firefox 1.5, Opera 8.53 and Netscape 8.0.1

CSS  |  Send
Posted 3/28/06 @ 5:44 AM by Matt Williams