Member Offer
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

css background rollovers, http requests opinions

Discussion in 'Website Design Forum:' started by Levi, Jan 7, 2010.

  1. Levi

    Levi Moderator Staff Member

    Ok question and opinion time again :)

    On my site that I'm working (smiley face below) on I've got rollovers using the css background approach (ie shifts up when hovered over) and when I use yslow to analyse the site it keeps complaining about the number of http requests and suggesting using sprites (no idea what they are).

    Now I currently have each background as an individual png file (they're all different) with the top being the normal and the bottom being the :hover image meaning I have 10 or so png files in 2 rows (top and bottom menu bits).

    I know that images and text can download in parallel but would I see any benefit of grouping the menu rows into one/two big images and then repeat the same background image on each link using the position and size bits to adjust for each link thus reducing the number of http requests but not necessarily reducing the files size?

    I don't think I will because it will still take just as long to download but I thought I'd get the opinions of the more experienced people :)

    ps. it looks like my 'test' page is an older version so just ignore the crap coding as it's been improved since then :)
  2. Harry

    Harry Senior Member

  3. Levi

    Levi Moderator Staff Member

    ah so its basically my idea but I didn't know what it was called :)

    So is this a better or worse approach?
  4. Harry

    Harry Senior Member

    Yeah it is I guess—shoulda said that lol.

    It's a good approach, but totally not essential. Go for it, it'll be a good thing to learn and will do no harm :)
  5. Levi

    Levi Moderator Staff Member

    cool, I'll do a tweaked page using a sprite version and then do a comparison on load times, file sizes etc :)

    Ta very
  6. Harry

    Harry Senior Member

  7. Levi

    Levi Moderator Staff Member

    that link didn't like my site, nothing major :)

Share This Page