SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    I solve practical problems. bronze trophy
    Michael Morris's Avatar
    Join Date
    Jan 2008
    Location
    Knoxville TN
    Posts
    2,026
    Mentioned
    64 Post(s)
    Tagged
    0 Thread(s)

    Optimization Question - IE 8 vs. the others.

    So, I have a fairly complicated background image on my site that I found I could get down to 70K if I split it up into layers and loaded in multiple backgrounds. Rather than do a 4 ply wrap on all pages, I'd rather just have IE 8 users suffer the pixelated 90K version. That leads to this CSS

    Code css:
    background: url(../images/background.jpg) top left no-repeat fixed;
      background: url(../images/background_l4.png) top left no-repeat fixed,
        url(../images/background_l3.png) top left no-repeat fixed,
        url(../images/background_l2.gif) top left,  
      	url(../images/background_l1.jpg) top left no-repeat fixed;

    Will the other browsers attempt to load the first background? If so, I'll need to push that declaration off to it's own IE specific stylesheet.

  2. #2
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Why not use Fiddler to monitor what is or is not downloaded?
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  3. #3
    I solve practical problems. bronze trophy
    Michael Morris's Avatar
    Join Date
    Jan 2008
    Location
    Knoxville TN
    Posts
    2,026
    Mentioned
    64 Post(s)
    Tagged
    0 Thread(s)
    I was wondering if anyone would know off hand.

  4. #4
    SitePoint Enthusiast
    Join Date
    Oct 2012
    Location
    Tinker Air Force Base, Oklahoma, United States
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Modern browsers will load the multiple backgrounds.

  5. #5
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,167
    Mentioned
    453 Post(s)
    Tagged
    8 Thread(s)
    Modern browsers should load the last one in the order, so I'd expect they wouldn't actually download the first bg image. But I can't vouch for it.

    If you want to make sure of it, you could serve the IE background in an IE-only style sheet via a conditional comment:

    Code:
    <!--[if lte IE 8]><link rel="stylesheet" type="text/css" href="/css/ie.css"><![endif]-->

  6. #6
    SitePoint Enthusiast
    Join Date
    Oct 2012
    Location
    Tinker Air Force Base, Oklahoma, United States
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    From experience, if the multiple background declaration comes after the single background dec, modern browsers will ignore the single background and load the multiple. No need for a separate stylesheet in this case.


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
  •