Home Tutorial Html Html5 HTML5  audio tag example, Use of audio tag  in HTML5.

 
 

Share on Google+Share on Google+
HTML5  audio tag example, Use of audio tag  in HTML5.
Posted on: September 3, 2010 at 12:00 AM
Advertisement
In this section, you will see the use and implementation of audio tag.

HTML5  audio tag example, Use of audio tag  in HTML5.

Introduction:

In this section, you will see the use and implementation of audio tag in HTML5. The <audio> tag is used to add audio in web page or HTML page. When audio tag is not used, browser asks for plugin or script for playing audio or music. It is a paired tag.

The Content present in audio tag will be displayed only when browser does not support.

Attribute of audio tag:

Attribute is used for providing more information to the browser about the tag. There are following attributes in audio tag:

1-autoplay
2-autobuffer
3-controls
4-loop
5-preload
6-src

Declaration Syntax :

Declaration syntax of audio tag in HTML5.

                            <audio src="URL"></audio>

The declaration of audio is case_ insensitive.

Example of <audio> in HTML5:

Code:
AudioTag.html
<!DOCTYPE html >
<html >
<head>
<title>Audio Tag </title>
</head>
<body>
<p><b>Example of audio tag in HTML5.</b></p>
<audio src="a1.mp3" controls="controls" >
Browser does not support audio tag.
</audio>
</body>
</html>
Output:

Download this code

Difference Between HTML5 and HTML4.01:

The audio tag  is only available in HTML5. It is not available in HTML4.01.

Advertisement

Related Tags for HTML5  audio tag example, Use of audio tag  in HTML5.:


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: September 3, 2010

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com