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

  • Home
  • SEARCH
  • 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 6785403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:07:21+00:00 2026-05-26T17:07:21+00:00

I am using the HTML5 Boilerplate and never had a problem with it until

  • 0

I am using the HTML5 Boilerplate and never had a problem with it until now, when I have started using Selectivizr. For some reason, which I dont understand, IE8 produced a Javascript error.

After some testing, I noticed that the error was gone when I stopped using the conditional browser comments (in the Boilerplate) that add a class to html depending on the browser you are using:

<!--[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]-->

As I said, when I remove the code above and replace it with <html> everything works fine.

Since I dont want to remove the conditional comments completely (they help me to write browser specific css), I thought of doing the same, but instead of applying it to html I will do it for the <body>:

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

Everything seems to work okay, but since I am a newbie, I would just like to verify that this workaround is okay? Or is there a downside?

And one more question offtopic: When a user visits the site with Firefox or Chrome, what body will be “used”? I guess it will “use” body without a class?

My logic would tell me to write another conditional comment, to make sure to “use” body for all other browsers, however in the official Boilerplate template no such comment exists and therefor I guess its not needed… Why not?

  • 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-05-26T17:07:22+00:00Added an answer on May 26, 2026 at 5:07 pm

    We actually originally had them on the <body> tag. 🙂

    We moved them for two small reasons:

    • The multiple classnames bug in IE6
    • CMS’s that use the body element for their own classes.

    You can move the classes to <body> without much problem. You can also leave lang=en on the HTML element, cleaning things up.

    More deets here: https://github.com/h5bp/html5-boilerplate/issues/44

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

Sidebar

Related Questions

I've started using HTML5, starting from the HTML5 Boilerplate . This includes modernizr, which
I'm using HTML5 Boilerplate and I have to use a custom font. So, I
I'm using HTML5 boilerplate and have a header tag going the full width across
I'm using the great HTML5 boilerplate. It's a great project but I'm having some
I have a page I am developing in .net using HTML5 intended for a
I am using HTML5 Boilerplate on a project. Unfortunately I am getting these SCRIPT438
I have made a game using HTML5 Canvas Element, Javascript for facebook. You can
Using HTML5 I have 2 Audio elements and 1 video element on a page.
I'm using thee latest awesome HTML boiler plate - HTML 5 BOILERPLATE Now if
I started using html5 canvas object on my web site and I want to

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.