Skip to content

Commit

Permalink
Prevent text inputs growing as you type in IE6/7.
Browse files Browse the repository at this point in the history
Applying *overflow:visible to button/input causes text inputs to
grow to fit their content, even if an explicit, fixed width is
applied. It was originally included to remove excess inner
spacing on buttons and submit/reset/button-type inputs in IE6/7.

Fixing this bug in IE6 requires dropping the fix entirely because
there is no way to avoid it being applied to text inputs. If
there is a need to fix this excess spacing bug in IE6, then it
should be done using a class that is applied to the
necessary elements.

For IE7, the excess spacing fix can be moved into the ruleset
that targets button and submit/reset/button-type inputs. This
prevents text inputs from growing.
  • Loading branch information
necolas committed Sep 22, 2011
1 parent 994cd08 commit 3cdf17e
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions css/style.css
Expand Up @@ -156,23 +156,17 @@ button, input, select, textarea { font-size: 100%; margin: 0; vertical-align: ba

/*
* 1. Define line-height as normal to match FF3/4 (set using !important in the UA stylesheet)
* 2. Correct inner spacing displayed oddly in IE6/7
*/

button, input { line-height: normal; *overflow: visible; }

/*
* Reintroduce inner spacing in 'table' to avoid overlap and whitespace issues in IE6/7
*/

table button, table input { *overflow: auto; }
button, input { line-height: normal; }

/*
* 1. Display hand cursor for clickable form elements
* 2. Allow styling of clickable form elements in iOS
* 3. Correct inner spacing displayed oddly in IE7 (doesn't effect IE6)
*/

button, input[type="button"], input[type="reset"], input[type="submit"] { cursor: pointer; -webkit-appearance: button; }
button, input[type="button"], input[type="reset"], input[type="submit"] { cursor: pointer; -webkit-appearance: button; *overflow: visible; }

/*
* Consistent box sizing and appearance
Expand Down

0 comments on commit 3cdf17e

Please sign in to comment.