saftutorials.com
HTML Audio Tutorial

HTML Audio tag use for Audio Content. HTML Audio use by < audio > tag. Its special HTML5 tag for Audio content. Its play your audio on your website. 

Supported file format.

1) MP3,

2) Wav,

3) Ogg.

How to use HTML Audio tag?

First write <audio> tag using this structure <audio control loop autoplay and more attributes> <source src="Your Audio source" type="audio/ogg"></audio>

Basic Structure of HTML Audio

<!DOCTYPE html>
<html lang="en">
<head>
<title>HTML Audio Tutorials</title>
</head>
<body>
<audio controls>
  <source src="../uploads/sample.ogg" type="audio/ogg">
  <source src="../uploads/sample.mp3" type="audio/mpeg">
  This browser does not support the audio tag.
</audio>
</body>
</html>

HTML Audio with CSS

<!DOCTYPE html>
<html lang="en">
<head>
<title>HTML Audio Tutorials</title>
</head>
<body>
<audio controls style="background:#000;border:3px solid red;">
  <source src="../uploads/sample.ogg" type="audio/ogg">
  <source src="../uploads/sample.mp3" type="audio/mpeg">
  This browser does not support the audio tag.
</audio>
</body>
</html>

 

Supported Browser

Internet Explorer: 9.0

Google Chrome: 4.0

Firefox: 3.5

Safari: 4.0

Opera: 10.0

UC Browser: 11.2

Supported Attributes

src - Audio Source.

controls - Specifies Audio controls.

autoplay - Control starting autoplay.

loop - Control Audio repeat.

muted - Control Audio Sound.


Video Tutorials coming soon...

Find us on

Facebook Google Plus Twitter Pinterest YouTube

web statistic