Search code examples
javascriptcssiconspngcss-sprites

What is it called when JS is used to show only a certain part of a png?


Let's say you have a png and it contains all of the icons that are to be used on one page, what is the process of using JS to select and display on a certain icon in that image? I've always seen it being done, but it seems to evade me what it is, and how to do it.


Solution

  • It's done with CSS, not JavaScript, and it's called sprites.

    http://css-tricks.com/css-sprites/