I had an interview last week and one of the questions asked was “Is it possible to play a sound using CSS?” .
I replied in the negative since i had no prior knowledge about the same. On searching the net, i found that no one had a single working example and all the answers tend to be negative. But on querying w3c i found something called pseudo-elements http://www.w3schools.com/css/css_pseudo_elements.asp
Below is the relevant section.
CSS2 - The :before Pseudo-element
The “:before” pseudo-element can be used to insert some content before an element.
The style below will play a sound before each occurrence of an <h1> element:
CSS2 - The :after Pseudo-element
The “:after” pseudo-element can be used to insert some content after an element.
The style below will play a sound after each occurrence of an <h1> element:
It works perfectly when i used a image file but not with a sound file.
Anybody got some clue???
Thanks to all…