Posts Tagged ‘IE CSS Hack’

CSS Hacking

Monday, December 14th, 2009

I know this is old news, but we have to deal with IE and CSS issues all the time.  I was using a technique that I called the “red-headed step child method,” which uses the CSS child selector, but it seems that IE has changed something that kept it from working.  So I’ve figured it out again.  Here is a sample:

.pricing {margin:9px auto;}
html>/**/body .pricing{margin-top:15px; margin-bottom:15px;}

With the above, IE will pick up the first statement.  Whatever you need to change for the other browsers, you use the html>/**/body selector.  IE will not pick up this statement with the /**/ included.  Let me know what you think about this fix and what techniques you use.