Tuesday, May 22, 2007

IE7 css hack

When IE7 came out last year I upgraded my css menus to account for the change in the box model from 6 to 7. Unfortunately the new css worked in IE7, but broke IE6 pages.
To fix the problem, microsoft has given us the helpful conditional tags. I put this on the base page of my site in the header and now IE6 and IE7 play nice.

<!--[if IE 7]>
<style type="text/css">
ul#nav li a { z-index: 100; width: 149px;}
ul li ul {left: 160px;}
</style> <![endif]-->

No comments: