Return to Snippet

Revision: 16661
at August 11, 2009 13:28 by Meander365

Initial Code
/* all browsers make border red */ 
	#anyelement { border : 2px solid red; } 
/* all browsers see this, but only IE thinks #IEroot exists as an element and makes border blue */ 
	#IEroot #anyelement { border-color : blue; } 

	<!--[if IE]>  
    	<div id="IEroot">       
    	<p id="IE">This browser is IE.</p> 
        <p id="notIE">This browser is not IE.</p>  
	<!--[if IE]>  

Initial URL

Initial Description
A wrapper may be made to enclose the content of a page, and then you can write descendant CSS rules that mention that wrapper's ID or class name in the selector. But what if only IE thought that wrapper existed? Then those rules would only work for IE, while other browsers would ignore the rules completely.

Initial Title
Targeting IE Using Conditional Comments and Just One Stylesheet

Initial Tags
css, ie

Initial Language