7.5 CSS Image Sprites

In the previous section, we used the a element not for its standard purpose of linking to a separate web page, but rather for loading an image into a frame within the current web page. In this section, we once again use the a element for something other than its standard purpose. We use it to implement a rollover. A rollover is when an image file changes due to the user moving the mouse over the image. Rollovers have been around for quite a long time. Early on, web programmers were limited in their ability to implement rollovers. They had to use JavaScript, which we’ll get to in the next chapter. In this section, you’ll take advantage of advances in CSS and learn how to implement rollovers without JavaScript. All you ...

Get Web Programming with HTML5, CSS, and JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.