Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,472
There are 1640 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     HTML/XHTML/DHTML/CSS :

CSS Sprites

Thread title: CSS Sprites
Reply  
Page 1 of 2 1 2 >
    Thread tools Search this thread Display Modes  
08-27-2010, 08:53 PM
#1
Jordan is offline Jordan
Jordan's Avatar
Status: #pugs {display: block;}
Join date: Jan 2007
Location: Chicago
Expertise: CSS, HTML, PHP
Software: Sublime Text 2
 
Posts: 1,187
iTrader: 7 / 100%
 

Jordan is on a distinguished road

  Old  CSS Sprites

I'm not a stranger to sprites but I primarily limit my usage of them. I don't toss every image into a sprite. I tend to just stick with navigation majority of the time although very rarely have I had a project that required extras.

I used to do headings but after Cufon/@font-face came to play I no longer do that.
  • How often do you use sprites?
  • Do you use them for EVERY image (backgrounds included but excluding those you need to repeat)?
  • Or just a few here and there?
  • Does it really make THAT big of a difference when it comes to shaving off some load time?

I've got a client right now that wants to have ALL non-repeating images put into a single sprite. Truthfully, it's a huge pain in the ass right now as the site is already fully developed.. So I'm having to ensure that a.) I'm grabbing all images, b.) the code isn't going to conflict with the already existing styles. And I really just don't see the point in having 60+ images in a single sprite file... but I've never been one that used that many images in the first place ;\.

Reply With Quote
09-11-2010, 06:19 AM
#2
Dan is offline Dan
Dan's Avatar
Status: Request a custom title
Join date: Feb 2005
Location:
Expertise:
Software:
 
Posts: 3,164
iTrader: 15 / 86%
 

Dan is an unknown quantity at this point

  Old

I use sprites for layout only.

I wouldn't recommend using them for images that are displayed as actual images on the site, but I've seen it done. :S

One thing to bear in mind is if your client ever wants edit one of the images to a large/smaller size.. that'll be quite the fudgecaked situation.. messing up the styling completely.

Though the amount of time you save from compressing alone is worth it.

Reply With Quote
09-11-2010, 11:55 AM
#3
Creatif is offline Creatif
Status: I'm new around here
Join date: Sep 2010
Location: France
Expertise: Web design/programming
Software: Photoshop, Netbeans, Firefox
 
Posts: 12
iTrader: 0 / 0%
 

Creatif is on a distinguished road

  Old

Like Dan, I only use sprites for layout images. Sprites are really useful but there are more noticeable ways of speeding up the website then what you'd gain by sticking together all the images into one sprite.

It's also not worth it if you're going to be making regular changes to the images. I do think there is one place they should always be used and that's with hover events, makes things much smoother.

In your clients case unless all of the images are loaded on the same page I really doubt that a sprite is necessary. I definitely wouldn't put 60+ in a single sprite that would be a nightmare to create & edit.

Reply With Quote
09-11-2010, 02:35 PM
#4
1901gt is offline 1901gt
Status: Senior Member
Join date: Mar 2005
Location: Singapore
Expertise: Web Design, XHTML/CSS
Software: Photoshop, Illustrator
 
Posts: 861
iTrader: 8 / 100%
 

1901gt is an unknown quantity at this point

  Old

I only use sprites for icons and repeated patterns.

Reply With Quote
09-12-2010, 09:08 AM
#5
Aziz is offline Aziz
Aziz's Avatar
Status: Junior Member
Join date: Sep 2010
Location: Israel
Expertise: Design, Web Development
Software: Photoshop, Dreamweaver, FF
 
Posts: 42
iTrader: 0 / 0%
 

Aziz is on a distinguished road

Send a message via ICQ to Aziz Send a message via AIM to Aziz Send a message via MSN to Aziz Send a message via Yahoo to Aziz Send a message via Skype™ to Aziz

  Old

I use sprites, more and more recently. I sprite almost all images, it does save up loading speed and you get maximum quality (if you're saving with PNG).

Here is one example:


but with time, I get better at it and know which elements to sprite and which elements to keep separated.

As for the editing, I always keep an organized PSD file with all images so I could easily edit, also with ruler guides so I could get the height, width, X and Y coordination of the specific image.

And the CSS coding, isn't that hard, it's all about background positioning the hard part is just getting each image's coordination.

Reply With Quote
09-12-2010, 03:31 PM
#6
Dan is offline Dan
Dan's Avatar
Status: Request a custom title
Join date: Feb 2005
Location:
Expertise:
Software:
 
Posts: 3,164
iTrader: 15 / 86%
 

Dan is an unknown quantity at this point

  Old

wow. sprites that large are surely going to have a negative effect?

Reply With Quote
09-15-2010, 12:15 AM
#7
PPP is offline PPP
Status: I'm new around here
Join date: Sep 2010
Location:
Expertise:
Software:
 
Posts: 1
iTrader: 0 / 0%
 

PPP is on a distinguished road

  Old

I usually do sprites but I am always trying to keep best balance between loading speed and number of files. It means that I sometimes prefer to have 2 different sprites, each one for example 50 kB, than one with weight of 200 kB. But I am usually fine with one.

Reply With Quote
09-15-2010, 10:57 AM
#8
Gaz is offline Gaz
Gaz's Avatar
Status: Request a custom title
Join date: Apr 2007
Location: UK
Expertise: Code & Programming
Software: Coda, TextMate, Sublime 2
 
Posts: 2,097
iTrader: 26 / 100%
 

Gaz will become famous soon enough Gaz will become famous soon enough

Send a message via Skype™ to Gaz

  Old

Aziz, I would think hard on whether that's the correct application of sprites. The whole aim of sprites is to decrease the number of HTTP requests to images. The more requests = the longer page load it will take.

Now the problem with making such a huge sprite image is not the number of HTTP requests. It is the question of size. On page load the browser will only have to make one request for images, the sprite, but it will take a long time to load. Granted, it will probably take less time than requesting each image separately, but it will still take some time. The problem with this is that while the image is loading no image is displayed. Just text. The whole image has to be loaded before background positions can be used and an image is displayed. Using a few, smaller sprite images would both reduce the number of HTTP requests than normal and to provide images of a weight that's quickly renderable.

Reply With Quote
Thanked by:
Aziz (09-15-2010)
09-15-2010, 04:03 PM
#9
handsonhosting is offline handsonhosting
handsonhosting's Avatar
Status: Junior Member
Join date: Mar 2010
Location: Omaha, Nebraska, USA
Expertise: Web Hosting, Servers
Software: Notepad
 
Posts: 63
iTrader: 0 / 0%
 

handsonhosting is an unknown quantity at this point

  Old

I use sprites quite often, as with the above, mainly for navaigation, logo and common images that repeat throughout the site (the whole purpose of sprites). Between the combination of sprites and then using a CDN to push all the content to the customers, we get pretty great speeds on sites and would never go back to regular images. Add in a little gzip/mod_deflate, and the site really starts to sing!

Reply With Quote
09-26-2010, 01:23 AM
#10
piraino is offline piraino
Status: I'm new around here
Join date: Sep 2010
Location:
Expertise:
Software:
 
Posts: 3
iTrader: 0 / 0%
 

piraino is on a distinguished road

  Old

I pretty much only use them for nav graphics that have a hover state.

I'm surprised to hear that people use such large sprites, with so many images packed into one file. I suppose overall load time might be a little faster (?), but I would think that the *apparent* load time would seem slower for the user, since as mentioned nothing will display until the entire image is loaded. At least with multiple files they can be downloading simultaneously and showing up as they come in. I haven't done any actual testing of this though, so maybe I'm wrong.

Reply With Quote
Reply  
Page 1 of 2 1 2 >


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed