Click here to Skip to main content
15,867,686 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
What is the html/css/javascript that lets you use one .png with multiple images on it to select only one of the images when the page first shows up and another when the first image is clicked on (for example: play now)

What I have tried:

I can use onmouseover when there is two separate images, but I can't figure out how to use code when there are multiple images (for example: play now) when all the images are on one image file.
Posted
Updated 12-Apr-16 12:46pm

1 solution

This is a nice question; I even voted 5, even though you could figure the answer by yourself.

It looks like there is no such feature, which I think would be great to have. This W3 document on HTML5 (latest HTML version) even states specifically:
W3 explains in the HTML5 article on "img" element:

src = non-empty URL potentially surrounded by spaces
A URL referencing a non-interactive, optionally animated, image that is neither paged nor scripted.

—SA
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900