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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T17:57:04+00:00 2026-05-17T17:57:04+00:00

This is going to be a vague and obscure question, which is probably due

  • 0

This is going to be a vague and obscure question, which is probably due to the fact that even using IE Web Developer, I have no idea what is going on.

I have a utility which I am working on. It’s mostly JavaScript, and it has a small floating DIV user interface that shows up on a page. So far, standard stuff. The problem is the background color of some DIVs in the UI. The colors are assigned by CSS, and (tired refrain:) it looks fine in Firefox, Chrome, and Opera, but of course IE is being difficult.

The background does not show up in IE in quirks mode or IE7 mode, but it does in IE8 mode. For the life of me, I can’t seem to figure out why IE7 isn’t showing the background.

The page you can see the offending code is here: Log Hound Demo. Floating DIV is in the upper-right-hand corner – click the “V” to open it up.

Looking at that page in IE and then in [any other browser on the planet] will show you the missing background colors easily enough. I swear, even Lynx renders it better… ahem. The offending DIV IDs are lhPlateHead, lhPlateCtrlPanel,lhPlateTagPanel – easy to find with Firebug at least. They should be heeding the .lhPlateColor class with a background color of #DFEAF8, but that color is never applied.

With IE web developer up, I tried removing the CSS classes and re-adding them. I tried every combination of browser and document mode – again, only IE8 browser mode in IE8 document mode had the background colors working.

If anyone is bored enough to take a look and figure something out, I’d be much obliged.

  • 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-17T17:57:04+00:00Added an answer on May 17, 2026 at 5:57 pm

    Well – I finally figured it out, and as far as I’m concerned, this is another reason IE will always suck.

    The circumstances of the problem are:

    1. You are creating an element programatically:
      myelmt = document.createElement('DIV')
    2. You are setting the styles of that element programatically:
      myelmt.setAttribute('class', 'myclass');
    3. You are then adding that element programatically to the DOM:
      body.appendChild(myelmt);
    4. You are using IE.
    5. IE hates you.

    In cases such as this, IE8 will honour the “myclass” css and style the element properly when it is added to the DOM. IE7 and I’m guessing below will blow off the CSS styling and leave you thinking that employment at McDonald’s is probably a whole lot less stressful.

    To recap for the impatient:

    Works in IE8 and EVERY OTHER BROWSER ON THE PLANET

    var myelmt= document.createElement('DIV');
    myelmt.setAttribute('class', 'myclass');
    body.appendChild(myelmt);
    

    Works in IE7 and below:

    var myelmt= document.createElement('DIV');
    var attr = document.createAttribute('class');
    attr.value = 'myclass';
    myelmt.setAttributeNode(attr);
    body.appendChild(myelmt);
    

    If someone can expound on exactly why this is a problem for IE7, feel free as I revel in the minutiae. Otherwise, just remember that it’s all fun and games until someone loses an object reference.

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

Sidebar

Related Questions

I may be going about this backwards... I have a class which is like
I'm sorry this question is going to be a bit vague because I'm not
This is going to sound like a silly question, but I'm still learning C,
I hope this isn't too vague, but I'm stuck on a problem that has
This is going to be the noobist of all noob questions, but what exactly
This is going to be hard to explain but I'll try my best. I
Is this functionality going to be put into a later Java version? Can someone
This is likely going to be an easy answer and I'm just missing something,
I know this one is going to be a long-shot, but I thought I'd
We currently use VSS 6, this is not going to change I am afraid.

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.