Linking to a sound file using a href allows a browser to open and play an audio file if the viewer of your web page has properly configured their Internet browser. You can also use thetag or the newer

tag

Example code

Play sound file

Result

Play sound file

With audio files, we recommend using the .MP3 file format because of its wide acceptance on the Internet, and is utilized by all browsers and operating systems.

The

tag

An older method of including audio files is to use thetag. While this method certainly works, it is less efficient than those which were mentioned above. As such, we recommend using one of the solutions demonstrated above.

  • How to insert a movie or video in an HTML document.
  • How to add pictures to an HTML website.
  • See our sound definition for further information and related links.
  • HTML and web design help and support.