• The background colors for my sidebars are not the same in IE7 as they are in Firefox. In firefox both of the backgrounds are white — as set in my stylesheet. In IE7 they are yellow and orange. How do you code for some/all browsers so that they look the same?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Simple terms, here are browser codes in css, with your own css selected in #code#:

    IE7:

    *+html #code# { }
    or
    *:first-child+html #code# { }

    IE6:

    * html #code# { }

    Opera:

    @media all and (min-width:0px) {
      head~body #code# { }
    }

    FF:

    html>body #code# { } // does this one still work, anyone?
    or
    html:not([lang*=""]) #code# { }

    A bit of advice though, code for FF then do the other alteration as needed, IE7 and IE6 will be the ones that don’t conform the most. I rarely run into any opera issues (and safari never has problems that I’ve seen).

    Thread Starter ad9f30

    (@ad9f30)

    First of all, thanks for your response. I’m somewhat ignorant of the details of coding in CSS. This is my code below. How would I incorporate the coding you gave me with it? Thanks again.

    #l_sidebar{
    width:160px;
    float: left;
    padding-right: 10px;
    padding-left: 10px;
    padding-bottom: 10px;
    background:#FFFFFF;

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘CSS and setting colors for different browsers’ is closed to new replies.