I have a simple div with a 2px thick border and absolute positioning thats hidden until its parent element is hovered over. Due to IEs box model, the position of said div is somewhat off in IE, but not any other browser. I don’t want to add an entirely seperate style sheet for IE, I just want to modify the class itself if the browsing person is using IE.
So how does one modify or add a specific class for IE only?
You need to use something called conditional comments. These only work in IE (other browsers will see them as comments) so they are a great way to target IE only.
Example – if you want something to be done in IE6 use the following:
To find out more, visit the official MSDN source regarding conditional comments.