IE7 z-index issues

If you have z-index issues, particularly with drop down menus in IE7 this conditional script may help.

<!--[if IE 7]>
	<script type="text/javascript">
		$(document).ready(function(){
			$(function() {
				var zIndexNumber = 1000;
				$('div').each(function() {
					$(this).css('zIndex', zIndexNumber);
					zIndexNumber -= 10;
				});
			});
		})
	</script>
<![endif]-->

Conditional CSS for Internet Explorer

To add stylesheets for specfic Internet Explorer versions you can add the blocks of code below to the head section of your HTML code. Make sure the code is placed beneath your main css declarations.

All IE Versions

<!--[if IE]>
<link rel="stylesheet" type="text/css" href="ie-all.css" />
<![endif]-->

IE6

<!--[if IE 6]>
<link rel="stylesheet" type="text/css" href="ie6.css" />
<![endif]-->

IE7

<!--[if IE 7]> 
<link rel="stylesheet" type="text/css" href="ie7.css">
<![endif]-->

You can also use other operators to target various version at the same time:

lt = less than
lte = less than or equal to
gt = greater than
gte = greater than or equal to
! = not equal to
& = AND [if (gt IE 6)&(lt IE 7)]
| = OR [if (IE 6)|(IE 7)]

Less or equal to IE8

<!--[if lte IE 8]>
<link rel="stylesheet" type="text/css" href="ie8-and-down.css" />
<![endif]-->