Questions tagged [conditional-comments]

Conditional Comments are a feature of Microsoft's Internet Explorer web browser. They allow a web page to check the browser version.

Filter by
Sorted by
Tagged with
0 votes
1 answer
155 views

Exclude part for all IE-versions in typo3

I would like to temporary exclude all version of the Internet Explorer (IE) from a specific part in my typo3 html file. I tried to comment it out this way: <!--[if !IE]> --> <p>Some ...
cd-media's user avatar
1 vote
0 answers
108 views

Outlook ignores conditional comments when forwarding email

I have optimized an email for Outlook. A content with max-width gets hidden, while the another one (with a set width="" in <td>) shows up. That is working fine so far. When this email gets ...
Ksenial's user avatar
  • 11
0 votes
1 answer
192 views

Why css class is not overridden for IE9?

I have piece of HTML code in which we are applying special css for IE9, IE10 & IE11. <!doctype html> <!--[if IE 9]><html data-placeholder-focus="false" lang="{%=...
Jayesh Dhandha's user avatar
4 votes
0 answers
1k views

Parsing HTML Email content inside of conditional comments (trying to avoid regex!)

I know how terribly wrong it is to (attempt to) parse HTML with Regex, which is why I'm trying really, really hard to avoid it. I have an app that generates HTML emails. We're using a big fancy ...
Adam Tuttle's user avatar
  • 19.5k
0 votes
1 answer
183 views

BeautifulSoup4 extract all types of conditional comments

What i try to do: Remove suspicious comments from html mails with bs4. Now i encountered a problem with so called conditional comments of type downlevel-revealed. See: https://learn.microsoft.com/en-...
tzanke's user avatar
  • 198
0 votes
1 answer
887 views

Why is Outlook conditional content showing in Apple mail?

I'm wrestling with an HTML email design destined primarily for Outlook/Office 365. Following advice on various sites I'm wrapping my content table in conditional comments in order to give it a fixed ...
RickL's user avatar
  • 524
0 votes
1 answer
264 views

Do Handlebars work with Microsoft Conditional comments?

We use conditional comments for our html email templates, as well as handlebars. I'm just wondering if handlebars can be used inside conditional comments like so: <div> ...
user7711695's user avatar
10 votes
2 answers
7k views

Vue html comment handling

I'm using Vue to produce some html template, I need to include the html conditional comments as per code below. var productTemplate = new Vue({ el: '#myApp' }); <script src="https://...
Adriano's user avatar
  • 3,808
1 vote
0 answers
895 views

IE11 does not react to conditional comments [duplicate]

I am using asynchronous javascript functions on my website, which are not supported by Internet Explorer 11 or lower. Therefore, I want to show a warning to IE users. To achieve this, I used the ...
Gasp0de's user avatar
  • 1,209
0 votes
0 answers
781 views

Extracting <script> from HTML with BeautifulSoup

I'm searching through an html file with BeautifulSoup's find_all function. I'm having a couple problems with this. First, since I want to find only the <script> tags, I have to use soup.find_all(...
plshelp's user avatar
  • 45
1 vote
1 answer
84 views

What is the purpose of the extra <!--> in some IE conditional comments?

In the latest version of WordPress, there is a section of the page with the following code: <!--[if lte IE 8]> <script type="text/javascript"> document.body.className = document.body....
John Doe's user avatar
  • 212
1 vote
0 answers
494 views

mysqldump creates conditional comments that lead to errors when restoring

the mySQL Dumps created with mysqldump contain conditional comments like this: /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE ...
Jochen Kunze's user avatar
0 votes
1 answer
59 views

What is the intent of this IE-conditional hack?

Can you tell me what is supposed to happen for IE browsers? <!DOCTYPE html><!--[if lt IE 9]><html class="no-js lt-ie9" lang="en" dir="ltr"><![endif]--><!--[if gt IE 8]>&...
Bhoboco's user avatar
  • 13
0 votes
0 answers
62 views

Add Class on commented code or conditional code

Is possible manage conditional code by jQuery or javascript <!--[if IE]> <div class="ie">IE ALERT</div> <![endif]--> $('.ie').addClass('ie-additional-class'); The jsfiddle ...
ShibinRagh's user avatar
  • 6,530
1 vote
1 answer
28 views

Why does IE9 on emulation mode render conditional comments?

I am testing css with conditional comments on internet explorer 9 using emulation mode, however it seems to render the css on screen as text. why is this happening? <!--[if IE]> .path2 { ...
Sai's user avatar
  • 811
25 votes
2 answers
33k views

What is the meaning of `lt` in `[if lt IE 9]`

What is the meaning of lt in the following script? <!--[if lt IE 9]> <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/r29/html5.min.js"> </script> <![endif]-->
Masayuki Suzuki's user avatar
0 votes
1 answer
1k views

Conditional comments not working in ie11

I'm trying to use conditional comments to load webcomponents polymer polyfill on ie11 and webcomponente-lite polyfill on ohter browser so I have: <head> <meta charset="utf-8"> <meta ...
Daní's user avatar
  • 355
-1 votes
2 answers
1k views

IE11 Conditional CSS Comment does not work

I have tried several conditional formats as seen in different sites but can't seem to get this to work. Browser version is IE 11. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "...
Alex M's user avatar
  • 371
0 votes
1 answer
47 views

Conditional Statement add css in them [closed]

Is it possible to do the following with conditional comments: <!--[if IE]> .ie-only{margin-top:-13px;} <![endif]-->
Roberto Flores's user avatar
0 votes
1 answer
394 views

Is there a way to show Email content only on Outlook Browser?

Is there a way to show email content only on Outlook.com (the browser version) and hide for the rest? Example: <!--[if !mso]><!-- --> Show this for all platforms except Outlook ...
Diego Mendonca's user avatar
0 votes
0 answers
255 views

Conditional Comments IE 11 Behavior

I'm trying to build a simple conditional comment to check if the user has anything less than the IE9... Tried this just to debug the conditions, inside the body: <!--[if !(IE)]> <SCRIPT ...
MckPT's user avatar
  • 35
1 vote
0 answers
22 views

Conditional meta tag works on linux (Firefox) - it shouldn't

My page don't support IE 9 or bellow, so I add conditional comment in index.php file: <title> Title </title> <!--[if lte IE 9]> <meta http-equiv="...
Makla's user avatar
  • 9,929
0 votes
1 answer
310 views

conditional comments IE 9

I have one line of CSS to change on a couple of classes on a Wordpress site to make it backward compatible to IE9 (it is currently on a localhost site in development). The CSS i need to turn off is ...
pjk_ok's user avatar
  • 618
-1 votes
2 answers
2k views

Else in html conditional for ie

I want to load a .css file if the browser is ie8 or lower and other file if the browser is greater than ie8 or other browser (chrome, safari, etc). I've read that ther isn't an else in html ...
joacoleza's user avatar
  • 775
0 votes
0 answers
21 views

ie breaks head element on conditional comment

I've got something strange. We've got multiple servers, some of which we use internal, some of which we use external. Now we use one of those internal servers as a testserver for a website. This is a ...
Golovior's user avatar
  • 125
0 votes
0 answers
32 views

IE conditional comments doesn't apply on every versions targeted

So i would like to redirect some IE users to a specific page. While it is working on IE 7 and 8, according to NetRender and Browserstack, it's not on IE 6 and 9. I don't know why. Here's my code: &...
Zac's user avatar
  • 121
2 votes
1 answer
752 views

Target IE 9 AND less with conditional comments

First off I'm sorry if this has been answered already I just spent 45 minutes trying to find and answer and couldn't come across one that I felt sure about. I'm trying to use flexbox on my site and am ...
Bryan Willis's user avatar
  • 3,562
-6 votes
1 answer
128 views

Coldfusion comments and IE conditional comments [closed]

Do you use two (HTML comments) or three (ColdFusion comments) dashes for inline IE conditional statements in a .cfml file? Example: <!--[if lt IE 9]> <script>..do something..</...
Doug Hill's user avatar
0 votes
1 answer
201 views

IE conditional comments not working in aspx page

I want to use the IE conditional comments to load the Angular scripts based on the IE version. But the conditional comments are not working, it throws error as angular is undefined? can anyone help me ...
Hari Krishnan's user avatar
0 votes
1 answer
447 views

Valid conditional comments to target non-IE browsers and specific IE versions

How do you use conditional comments to target Internet Explorer only Certain IE versions Certain IE versions and all other browsers No IE, just other browsers in a way that validates? (validator.w3....
jkdev's user avatar
  • 11.4k
4 votes
2 answers
2k views

How to use meta tag in a browser version condition (IE 10 and above)?

I'm using IE11. And I have to force the browser to act as IE 10 with a condition if the browser is IE11. Because of Microsoft removed support for Conditional Comments, I'm struggling to figure out a ...
Drag0nKn1ght's user avatar
0 votes
0 answers
24 views

h:outputStylesheet and client-side conditional comments [duplicate]

I don't expect somebody has an answer for this question but is there a good way to use JSF h:outputStylesheet with client-side conditional comments for Internet Explorer? I know h:outputStylesheet ...
Kaz Nishimura's user avatar
0 votes
1 answer
24 views

IE conditional content showing up on chrome mobile

My HTML content is divided up into two sections: one that displays on IE8 and older, and one that shows up on ie9+ or "not IE". This seems to work fine on desktop, but when viewing via chrome mobile, ...
Mike Chivington's user avatar
0 votes
1 answer
67 views

Does ie read stylesheets outside of conditional comments?

I've been doing a bit of reading around this subject, and I can't seem to find an answer that specifically answers this question. Using this code as an example: <!--[if lte IE 7]> <link ...
Mike Chivington's user avatar
2 votes
2 answers
55 views

How to interchange between JS scripts using conditional comments

So I have a popup that opens from my home page through a "?" link. I wan run one script (Help.htm) to run if the user is using chrome, FF, Opera etc and a second script (Help_IE.htm) to run if the ...
luke-sully's user avatar
0 votes
2 answers
59 views

Loading JavaScript files - conditional concatenation

To reduce http requests, I'm using grunt to combine all of my scripts into 2 files: scripts-head.js and scripts-body.js. There are some scripts (shims, for example) that only need to be served to ...
jbyrd's user avatar
  • 5,337
0 votes
1 answer
35 views

Conditional comments and compatibily mode versions mismatch

I'm changing the UI of e-learning management system (ELMS) which comes as SaaS. Due to the company policy to use Internet Explorer and ELMS specifics we should use IE in Compatibily mode (else - some ...
user2342835's user avatar
0 votes
1 answer
319 views

IE 7 meta tag in condition

When I add meta tag in if condition it destroy the UI <!--[if IE lt 10]><meta http-equiv="X-UA-Compatible" content="IE=7" /><![endif]--> <meta http-equiv="Content-Type" ...
cpVariyani's user avatar
2 votes
1 answer
75 views

IE version check stopped working

I have just released a new version of a web app into test (maven based java app). It checks for old versions of IE and displays a box warning that it is out of date if less than version 9. This is ...
gringogordo's user avatar
  • 2,000
1 vote
1 answer
1k views

How can I use JavaScript/jQuery to conditionally add a stylesheet?

I've looked online for a suitable solution to the following issue and I can't seem to find a useful workaround; We're using Umbraco CMS to display a client's website, this isn't allowing us to add in ...
Achello's user avatar
  • 17
1 vote
0 answers
85 views

Conditional comments in JSF app are being rendered in IE 8 & IE 9 [duplicate]

I have the following JSF 2.1.20 code <!DOCTYPE html> <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> <!--[if IE 7]> <html class="no-js lt-...
MHosafy's user avatar
  • 176
1 vote
1 answer
84 views

IE 8 specific stylesheet won't work using Conditional Comment

My site simply has the words "Why is this text small?" on the screen. It is properly responding to the css styling applied to it, but not in IE 8. The html is: <!--[if IE 8 ]> <p>Only ...
Nova's user avatar
  • 423
2 votes
1 answer
2k views

Remove almost all HTML comments using Regex

Using this regex expression: preg_replace( '/<!--(?!<!)[^\[>].*?-->/', '', $output ) I'm able to remove all HTML comments from my page except for anything that looks like this: <!--[...
Rich's user avatar
  • 1,136
0 votes
0 answers
17 views

Compiling IE styles in a seperate stylesheet [duplicate]

I'm looking at ways to compile all of my IE styles into a separate stylesheet to cut down on the file size of my main stylesheet. I would then pull in those IE styles using conditional comments. I ...
abbas_arezoo's user avatar
  • 1,038
0 votes
1 answer
141 views

Internet Explorer + Windows Phone IEMobile Conditional Comments

So I've been using these two combinations of IE conditionals: <!--[if (IE)|(IEMobile)]> <script type="text/javascript"> // Do something </script> <![endif]--> ...
PowerUser's user avatar
  • 812
0 votes
0 answers
878 views

How to use freemarker comments to add IE conditional comments?

I have freemarker templates with IE conditional comments. After the templates become html templates I still see the other IE conditional comments. So I'm trying to clean up my templates by using ...
user730009's user avatar
1 vote
1 answer
252 views

Conditional comment for !IE breaks for old versions of Firefox

I am in a situation where I need to load one of two stylesheets based on what browser is accessing the page: if anything but IE then load the "new" stylesheet if IE >= 9 then load the "new" stylesheet ...
Jordan H's user avatar
  • 52.8k
1 vote
0 answers
685 views

html conditional comment for iOS

I am trying to use a conditional comment to check for iOS (like <!--[if IE 9>… but for an iPhone or mobile device. Any help? and I am NOT asking for CSS or JavaScript
krummens's user avatar
  • 837
0 votes
1 answer
163 views

Using conditional comments removes content?

I've been using conditional comments as a way to ensure a background image displays correctly in Internet Explorer 8. However, when I do, some of the content (some text and an image) disappears. ...
Thassa's user avatar
  • 532
3 votes
1 answer
2k views

Why are conditional comments in HTML not recognized in Internet Explorer 11? Is it not supported now?

I want to display different content on different browsers. I used Internet Explorer 11 and Google Chrome 39. But, in Internet Explorer and all other browsers "Not Internet Explorer" is displayed. Is ...
Rajesh Surana's user avatar

1
2 3 4 5