Skip to content

Instantly share code, notes, and snippets.

@rynmrtn
Created July 28, 2009 15:09
Show Gist options
  • Save rynmrtn/157431 to your computer and use it in GitHub Desktop.
Save rynmrtn/157431 to your computer and use it in GitHub Desktop.
IE Hacks
/*
* IE Centering Fix: text-align applied to the body of a page in IE6 will
* allow the containing divs to be centered (using `margin: 0px auto`).
* We also change the #container to be `text-align: left` because nobody
* likes their text being centered.
*/
body {
text-align: center;
}
div#container {
text-align: left;
}
/*
* Fixes Button Width Issue
*/
button {
width: auto;
overflow: visible;
}

In some versions of IE, clicking a radio button will not fire the onchange event. The easiest fix for this is to do the following:

<input type="radio" name="green" value="Green" onclick="this.blur()" onchange="someSortOfTask()"/> 

Calling this.blur() will remove the focus from the input in IE, which will allow the onchange event to be fired.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment