Page 1 of 1

Conditional comments

Posted: Thu Jan 30, 2014 11:08 am
by RSteinwand
Hi Albert,

I've been scratching my head for weeks, wondering why the html5 boiler plate conditional comments work for my public site, my secure site, but not for reports, then discovered this:

Code: Select all

<!DOCTYPE html>
<!--[if IE 7]>	<html lang="en-US" class="ie7 lt-ie10 lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>	<html lang="en-US" class="ie8 lt-ie10 lt-ie9"> <![endif]-->
<!--[if IE 9]>	<html lang="en-US" class="ie9 lt-ie10"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en-US">
<head>
Line 5 (the Iine before the <head> tag), had no closing conditional tag and CSE didn't catch it. It should look like this:

Code: Select all

<!DOCTYPE html>
<!--[if IE 7]>	<html lang="en-US" class="ie7 lt-ie10 lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>	<html lang="en-US" class="ie8 lt-ie10 lt-ie9"> <![endif]-->
<!--[if IE 9]>	<html lang="en-US" class="ie9 lt-ie10"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en-US"> <!--<![endif]-->
<head>
If you're not familiar with the advantage of these tags, here's some reading material:

http://www.1stwebdesigner.com/design/sn ... ilerplate/
http://www.paulirish.com/2008/condition ... r-neither/

It lets me do stuff like this in my style sheet:

Code: Select all

.pagetop{color:#fff;background:#001134;background:linear-gradient(to bottom,rgba(63,78,115,1) 0%,rgba(28,43,82,1) 14%,rgba(0,15,55,1) 26%,rgba(0,15,55,1) 100%)}

.lt-ie10 .pagetop{background:#001134 url('/images/horz_gradients_oldIE.png') 0 0 repeat-x}

Re: Conditional comments

Posted: Thu Jan 30, 2014 11:21 am
by Albert Wiersch
Thanks Rick! CSE HTML Validator doesn't check for this but it would be a good addition. I'll look into it for a future update.

Re: Conditional comments

Posted: Thu Jan 30, 2014 12:03 pm
by RSteinwand
Thanks Albert.