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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:56:13+00:00 2026-05-25T23:56:13+00:00

I am currently developing a theme for a homepage but ran into a few

  • 0

I am currently developing a theme for a homepage but ran into a few problems. For whatever reason I have no access to editing the html code itself, and I need to write custom .css for IE (specifically versions below IE9).

I have “two” issues. First one is dual backgrounds. Versions below IE9 can’t seem to render them flawlessly. If IE skips the element, this is fine but since the graphic in this element co-works with another element (for a smooth graphical transition), it makes the other element look weird. The graphic in this second element is a background within a div-box. I want this background to be another custom background that’s only rendered if the user is using IE as browser; and if possible, I want this to only apply to versions below IE9 (site is rendered with dual backgrounds just fine in IE9).

http://patrikarvidsson.com/project/sohelp/illustration.jpg

CSS is as follows (#mainframe is the part under the header navigation box). The lower image is how it is rendered in IE8. IE7 shows the same. First one is FF/Chrome/Safari and IE9.

#mainframe {
background: url('img/bg2.png') no-repeat,
            url('img/bg1.png') repeat-y !important;
}

I’ve searched quite a lot on the net, also been asking friends and this does not seem to be working without writing conditional comments within the html markup. Am I missing something? Is this doable somehow with only the use of .css files?

Site is using jquery. I don’t know this stuff, but I thought I’d mention it just in case.

  • 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-25T23:56:13+00:00Added an answer on May 25, 2026 at 11:56 pm

    You might want to look into this article which explains how to use conditional comments to set classes on the html element. You can then use that class to target specific browsers in your stylesheet, in a clean way.

    Your html tag would look something like this:

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

    Edit 2

    Since the announcement that IE10 will not support conditional comments I though it would be nice to update this answer. I tested the type of comments it will support and it seems that the above will still work, but if you want to target higher than 10 or only 10 you will be out of luck. As suggested by Microsoft themselves on their blog (link in comments @MarcoDemaio) you should use feature detection.

    Then you can do something like this in your css:

    .somestyle {
        background: transparent url('derp.jpg') no-repeat;
    }
    
    /* ie6 fallsback class */
    .ie6 .somestyle {
        background: #eee; 
    }
    

    Read the article, and good luck 😉

    Edit 2:

    Since IE7 isn’t my greatest concern anymore and IE9 is pretty consistent in its behaviour I can get away wil just the following code (which will add a class only for IE versions less than IE9):

    <!--[if lt IE 9]><html class="lte9"><![endif]-->
    <!--[if gt IE 8|!IE]><!--><html><!--<![endif]-->
    

    Edit 1:

    Ok I managed to miss your “can’t edit html” comment.

    In that case you can only use browser specific hacks, I think they’re dirty as hell but hey, if you have no other option……

    Somthing like this:

    .someclass {
        *color: blue; /* IE 7 and below */
        _color: blue; /* IE 6 */
    }
    
    /* IE6, IE7 - asterisk hack */
    .someclass  { *color: blue; }
    
    /* IE8 - winning hack */
    .someclass  { color: blue\0/; } /* must be last declaration in the selector's ruleset */
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to wordpress and currently developing a theme on it. I have noticed
I'm currently developing a PHP application that's using an Access database as a backend.
I am currently developing a site and have a need for a javascript-based carousel/slider
I'm using the following to render the_tags() in Wordpress 2.9.2, currently developing a theme
I'm currently developing a custom theme for a client of mine. What I want
we're currently developing an application that makes extensive use of popup windows(*) and have
We are currently developing a server whereby a client requests interest in changes to
I was currently developing a desktop application in C# using mono and testing in
I am currently developing an approval routing WCF service that will allow an user
I am currently developing a Rails application using a database that was designed before

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.