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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T06:25:20+00:00 2026-06-03T06:25:20+00:00

In jade , I want to put in a html tag conditional as per

  • 0

In jade, I want to put in a html tag conditional as per this method, which puts in

<!--[if lt IE 7 ]> <html class="ie6"> <![endif]-->
<!--[if IE 7 ]>    <html class="ie7"> <![endif]-->
<!--[if IE 8 ]>    <html class="ie8"> <![endif]-->
<!--[if IE 9 ]>    <html class="ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html class=""> <!--<![endif]-->

at the top of a html file.

I tried

//[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
    ...

but jade ignores the html tag, and doesn’t write in the end </html> tag. This is invalid html, and results in IE not displaying anything at all.

Is there any way of doing it?

I’m thinking I’ll just use a javascript solution if there isn’t a way.

  • 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-03T06:25:21+00:00Added an answer on June 3, 2026 at 6:25 am

    This method works, with the closing html tag:

    !!! 5
    //if lt IE 7
        <html class="no-js lt-ie9 lt-ie8 lt-ie7">
    //if IE 7
        <html class="no-js lt-ie9 lt-ie8">
    //if IE 8
        <html class="no-js lt-ie9">
    // [if gt IE 8] <!
    html(class="no-js", lang="en")
        // <![endif]
        head
            title= title
    
        body!= body
    

    from: https://gist.github.com/kmiyashiro/1140425#comment-675550

    Update:

    As pointed out by kumar-harsh this behaviour has now been depreciated, if you need this functionality you now should use regular html:

    <!--[if IE]>
      <html class="ie">
    <![endif]-->
    <![if !IE]>
      <html class="not-ie">
    <![endif]>
    </html>
    

    from: https://github.com/visionmedia/jade/issues/1345?source=cc#issuecomment-31920732

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

Sidebar

Related Questions

I want to put Jade variable in tag attribute but it isn't evaluated. a(href=/logout/#{user.name})
Consider this snippet of Jade: if(#{episode[question.name][field]}) #{episode[question.name][field]} I want to check if the value
I want to use underscore function in jade template, like this p= _.keys(user) Not
Please click on the Jade on this page: http://sneakyrascal.com/starpons/gallery.html I added a fancybox to
I want to use compiled jade templates on client side. How should I compile
I tried this in jade served by express but got unexpected identifier as an
I'm using Node.js with Express, Connect, and Jade. I want to provide an absolute
I have the following HTML structure: (jade template language) #review-item-1.review-item a.submit-review-toggle(href=#).review-item-toggle + h3 Service
I have layout.jade: html include includes/head body header h1 Jumplink design p web design+creative
I have this piece of code in one of my .jade files: each item

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.