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 8159423
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T17:54:24+00:00 2026-06-06T17:54:24+00:00

My goal is to remove IE conditional comments from my documents’ <head> , but

  • 0

My goal is to remove IE conditional comments from my documents’ <head>, but I recognize that I still need to use ie6,7,8-specific stylesheets (correct me if I’m wrong).

For example, these IE conditionals are used by HTML5Boilerplate 3.0:

<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
<!--[if lt IE 7]><html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"><![endif]-->
<!--[if IE 7]>   <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]>   <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->

So instead I’m thinking that I’d like to use JavaScript to add classes to my html tag resulting in this (as illustrated here):

<html lang="en" class="ie6 ie7 ie8">

So my question: What are the drawbacks (consequences) of using JavaScript to add CSS classes to my documents’ html element versus using IE conditional comments?

One effect I can think of right now:

  1. The IE client may have JavaScript disabled. For me this isn’t a problem; clients visiting my site are required to have JS enabled.

EDIT: I’m going to go ahead and concede that the most reliable way to add those classes is (sadly) to use IE conditional comments. Thanks all for the dialog.

  • 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-06T17:54:27+00:00Added an answer on June 6, 2026 at 5:54 pm

    Another thing is, JavaScript alone is not a good idea to perfectly detect the browsers. Have you heard of User Agent Spoofing? JavaScript detects a browser by User Agents. But, if a browser comes with a spoofed User Agent, then Firefox can act like Chrome. Hope you get it!

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

Sidebar

Related Questions

My goal is to remove from the raw stack the records that are not
My goal is to remove home from any actions in that controller (see bold).
Goal is to make a dialog that appears on menu_key pressed, but it keeps
Goal: Produce an Excel document with information from 3 associated models that is similar
My goal is to remove all <[script]> nodes from a document fragment (leaving the
My goal is to delete a user from the user list in my application.But
Basically, my goal is to remove everything inside ()'s except for strings that are
My goal is to remove all hover feedback from the UI. The motivation is
This is the goal: to remove Navigation Bar in some of the editors (no
Goal: Gain datatype date with year and month Problem: Need to help to convert

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.