@_jscript_version and Styling new HTML5 Elements in Internet Explorer (IE) 9

This post dig into a real-world example for writing cross-browser code. "The conversation began around a piece of code like the following:// DON'T USE THIS /*@cc_on @if( @_jscript_version < 9 ) // Enable styling of new HTML5 elements ... @end @*/The goal of this code is to detect and work around a missing feature. In […]

This post dig into a real-world example for writing cross-browser code. "The conversation began around a piece of code like the following:

// DON'T USE THIS
/*@cc_on
	@if( @_jscript_version < 9 )
		// Enable styling of new HTML5 elements
		...
	@end
@*/

The goal of this code is to detect and work around a missing feature. In this case the feature is styling new HTML5 elements, or more specifically, using CSS to customize the display of new HTML5 elements. As written, this code fails to run in IE9 Compatibility View and ends up leaving new HTML5 elements without styles. In IE9 Standards Mode this is not a problem as IE9 enables styling for all elements by default," writes IE team.

More Info: Same Markup: Explaining "@_jscript_version" and Styling New HTML5 Elements