Page 105 - CodePilot V5.0 C7
P. 105
HTML5 has introduced the <SOURCE> tag to specify the source of the audio or video file.
It is an empty tag.
The attributes to be used with the <SOURCE> tag are:
Attribute Name Value Description
SRC URL or path of the file It specifies the path to the audio or video to be
inserted.
TYPE File type It specifies the Multipurpose Internet Mail
Extensions (MIME) type of the file to be played.
Note that the SRC attribute can be used with the AUDIO and VIDEO tag directly also. Using it with
a nested <SOURCE> tag allows you to specify multiple media resources for media elements, such
as <VIDEO> and <AUDIO>, which the browser may choose from, based on browser support or
viewport width. The browser will choose the first <SOURCE> it supports.
Code Write the HTML code to present the given web page using the <AUDIO> tag to
10 embed audio.
<!DOCTYPE HTML>
<HTML>
<HEAD>
<TITLE>Using Audio Tag</TITLE>
</HEAD>
<BODY>
<H2>What is Artificial Intelligence?
</H2>
<P>Artificial Intelligence is the ability of machines to simulate human
intelligence.</P>
<AUDIO CONTROLS AUTOPLAY LOOP>
<SOURCE SRC="Artificial_Intelligence.mp3" TYPE="AUDIO/MPEG">
Your browser does not support the audio element.
</AUDIO> SHORT SIGN
HTML provides the structural
</BODY> skeleton of a web page, similar To quickly switch
to how natural formations like between applications:
</HTML>
mountains and valleys define the Alt + Tab
landscape of an environment.
103
Making Web Pages Alive

