How do I play music using CSS?

audio, css, html

Solution

Music is content. CSS is presentation, not content.

You can embed audio in HTML:

<audio src="path/to/song.mp3" controls autoplay></audio>

This is minimal, though, so it won't work in Firefox for instance since it doesn't support MP3. There are tutorials for this.

Problem

How do I make music play when my page loads using CSS? I need music to automatically play and have controls for it.

Original source