Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7803987
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T01:45:54+00:00 2026-06-02T01:45:54+00:00

I am using the following IE conditional comment: <!–[if gt IE 7]> Here is

  • 0

I am using the following IE conditional comment:

<!--[if gt IE 7]>
Here is some code.
<![endif]-->

This works great to keep the code from rendering in any IE lower than 8.
However, this also keeps the code from rendering in Chrome and Firefox.

Any ideas on why this is happening, and how I can get the code to render in browsers other than IE?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T01:45:55+00:00Added an answer on June 2, 2026 at 1:45 am

    Conditional comments are a Microsoft IE-specific rule, and they are not part of any standard. If you check the structure of a conditional comment:

    <!--[if gt IE 7]>
    Here is some code.
    <![endif]-->
    

    As its name would imply, it is all just a big comment <!-- comment -->. IE checks comments for conditions such as these which, again, do not comply with HTML standards.

    To create code which doesn’t render in IE, but does render in other browsers, you use the following conditional:

    <!--[if !IE]> -->
    This will be rendered by anything but IE.
    <!-- <![endif]-->
    

    See how the conditions are enclosed in closed comments? That’s why that is rendered in normal browsers, while IE checks for the conditional, and decides to omit everything up until the endif.

    EDIT

    If you want to add another condition, and keep rendering the code on non-IE browsers, you could use the following workaround:

    <!--[if gt IE 7]> <!-- -->
    Here is some code for anything but IE 7 and below.
    <!-- <![endif]-->
    

    Note I had to use open the comment again to prevent IE from rendering --> before the code. Other browsers will still consider it part of the comment.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the following conditional statement to read from standard input. if ((n
using the following code to prevent any version of IE prior to IE8 from
I have folowing code in which i am using some conditions on page to
Using following code I try to get updated list of checkbuttons' corresponding text values,
I using following code: var search = 'test'; if ($('#sku').find(search) ){ //alert(search); $(document).find(search).css('color','red'); <TABLE>
I am using following code in rowdatabound function. Protected Sub gvwMileStone_RowDataBound(ByVal sender As System.Object,
I'm using following peace of code to output an array: echo ======output without array_unique=====;
I am using following code to check whether a check box on my website
I am using following code to design my home page. The output (as shown
I'm trying to write some microcontroller code using Texas Instruments examples, and it uses

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.