Add to Favorites

Down and Dirty CSS Hacks

Preface: These are not always the proper way to fix browser consistency issues, but when you are in a jam this is a quick and easy way to make IE6 and 7 behave nicely.

Most coders are familuar with the underscore hack ( _width:100px; ) when dealing with inconsistencies in IE6. The whole idea behind this is Firefox ignores the style because of the extra character in front of it, but for reasons unknown to me IE6 recognizes it as a valid style. When you couldn't get IE to do what you needed it to this was a great way to beat it into submission. Until... IE7. When IE7 was introduced Microsoft wised up to this little trick. IE7 does not recognize the underscore style as valid.

Don't fret. There is a solution, and it comes in the form of the *. Once again you can foil IE6 and 7 by just adding an extra character to the front of your style. (*width:100px;) Firefox still ignores this style, but IE loves it. When used in conjunction with the underscore method you can avoid almost every bug and inconsistancy IE can throw at you.

Comments

Be the first to leave a comment on this post.

Leave a comment

To leave a comment, please log in / sign up