SitePoint Sponsor

User Tag List

Results 1 to 14 of 14
  1. #1
    SitePoint Addict
    Join Date
    May 2006
    Posts
    250
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    IE adding a background color

    Hi all]check out this page (link removed) in something decent (FF etc) look at the jQuery slider at the top. In IE its adding a green background colour to #scroll div.

    Can anyone see why?!

    Thanks
    Last edited by mikeebee8; May 28, 2009 at 02:10.

  2. #2
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,556
    Mentioned
    183 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    I think your script is applying opacity to the slider which IE doesn't understand.

    You could try something like this in the IE styles.

    Code:
    #scroll div{
    filter:Alpha(Opacity=40);
    -ms-filter: "Alpha(Opacity=40)";
    zoom:1.0
    }
    Not sure if it will do much good though

    On another matter why are you making poor old IE load three stylesheets.? You only need the differences in the IE stylesheet and not all the other styles as well. This makes debugging very difficult indeed.

    I also note that you have this comment above the doctype.

    Code:
    <!-- HTML 4.01 Strict - ensure code below is HTML compliant -->
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
        "http://www.w3.org/TR/html4/strict.dtd">
    <html lang="en">
    Perversely that will do the exact opposite of what you want and will trip quirks mode in IE6

    Remove the comments or move them after the doctype. Nothing should be above the doctype as far as IE is concerned.

  3. #3
    SitePoint Addict
    Join Date
    May 2006
    Posts
    250
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Paul, thats kinda working. Its fading the full div not just the background though (take a look)

    On the multiple stylesheet front I'm working on someone else's templates putting them into a CMS so I'm going to leave them be and just advise. Its a bit of a maze! Thanks for pointing it out.

  4. #4
    SitePoint Addict
    Join Date
    May 2006
    Posts
    250
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is there a way of targeting the opacity of just the background?

  5. #5
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,782
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)
    No I'm afraid there is not. Opacity applies to the entire element, children and all.
    Always looking for web design/development work.
    http://www.CodeFundamentals.com

  6. #6
    SitePoint Addict
    Join Date
    May 2006
    Posts
    250
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmm I'm very surprised that the jQuery script I'm using doesn't fix this for IE. There seems to be numerous references to opacity in the script but nothing as simple as opacity: true. I don't know any JS so I'll head over to the Javascript forum. Thanks guys.

  7. #7
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,556
    Mentioned
    183 Post(s)
    Tagged
    6 Thread(s)
    HI Mike,

    Something like this seems to be working locally

    Remove the code I gave before and then add this to the IE css file.

    Code:
    #scroll * {background:transparent!important}
    Can't see where the actual color was coming from but it must be there somewhere

  8. #8
    SitePoint Addict
    Join Date
    May 2006
    Posts
    250
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thats done it thanks so much Paul!

    Errr while we're here in all versions of IE can you see why the first frame is in the correct position but the ones that follow are slightly to the left? Considering they are all the same markup!

  9. #9
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,556
    Mentioned
    183 Post(s)
    Tagged
    6 Thread(s)
    Have you removed the comments above the doctype as IE will still be in quirks mode and all the box model issues will be in effect.

    I couldn't actually see a shift to the left here but I may be looking at the wrong thing

  10. #10
    SitePoint Addict
    Join Date
    May 2006
    Posts
    250
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah thats fixed it!

    I'm a little cautious about removing that line as the site will have been built with that line there so I'm scared I'll open a can of worms.

    I'll advise the person that built it.

    Thanks Paul

  11. #11
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,556
    Mentioned
    183 Post(s)
    Tagged
    6 Thread(s)
    I'm a little cautious about removing that line as the site will have been built with that line there so I'm scared I'll open a can of worms.
    Yes that's the danger

    It all depends whether all the box model hacks have been taken care of - which they don't seem to be as you have rules like this.

    Code:
    #scroll div {
        width: 895px;
        height: 133px;
        padding: 12px 20px 10px 20px;
        float: left;
        background: transparent;
        display: inline;
        margin: 0 auto;
    }
    That will be all wrong in quirks mode. If they want to leave the doctype comments in place then the box model hacks should be done (but in reverse to usual of course as they need to apply to ie5/6/7 all the same (and if I remember correctly IE8 will trip into quirks mode also)).

    The font sizing needs a bit of work in iE6 as well .

  12. #12
    SitePoint Addict
    Join Date
    May 2006
    Posts
    250
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Heh there is a lot I'd change but I think I'll leave it to the original author. Thanks for all your help as always Paul.

    Mike

  13. #13
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,556
    Mentioned
    183 Post(s)
    Tagged
    6 Thread(s)
    No problem Mike - It's fun working on other people's code isn't it

  14. #14
    SitePoint Addict
    Join Date
    May 2006
    Posts
    250
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh its a hoot!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •