question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

IE conditional HTML comments don't play well with the rest of the document

See original GitHub issue

using the style_html function with a document that starts with:

<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]-->
<!--[if IE 7]>    <html class="no-js ie7 oldie" lang="en"> <![endif]-->
<!--[if IE 8]>    <html class="no-js ie8 oldie" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
    <head>

the entire indentation of the document is thrown off because of the IE conditional comments at the beginning of the file … tried using the unformatted option ['!--[if lt IE 7]', '!--[if IE 7]', '!--[if IE 8]', '!--[if gt IE 8]', '![endif]--', '!--'] but it breaks the entire styling.

Issue Analytics

  • State:closed
  • Created 12 years ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
bitwisemancommented, Jun 6, 2013

👍 Your kind words and encouragement have moved me.

0reactions
jonschlinkertcommented, Jun 6, 2013

lol thanks! much appreciated.

Read more comments on GitHub >

github_iconTop Results From Across the Web

IE Stylsheets/ Conditional comments Not working
So I used this conditional comment to link to the stylesheet. That doesn't work, and it will either use the default stylesheet or...
Read more >
Why “Conditional Comments” Are Bad, Repeat: Bad
Conditional Comments guarantee your HTML to be changed, because they mix to-be-separated structure and presentation. No matter how you use CC, ...
Read more >
Internet Explorer Conditional Comments - SitePoint
Conditional comments use a special syntax—HTML markup wrapped in a conditional statement—and are placed within an HTML comment.
Read more >
Things You Might Not Know About Conditional Comments
Use of conditional comments to target certain versions of Internet Explorer is pretty commonplace nowadays, and is generally seen as the ...
Read more >
Conditional stylesheets vs CSS hacks? Answer: Neither!
Also - Yahoo's internal coding best practices do not recommend ... 2010.05.20: Turns out IE conditionals around css files for IE6 can slow ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found