Page 61 - Code & Click - 8
P. 61
2. Save the first file as ‘Parts of Computer 2.html’ and the
second file as ‘Keyboard2.html’.
3. Open the ‘Parts of Computer 2.html’ file in Microsoft Edge.
The document is displayed as shown in the image.
4. Click the picture of the keyboard.
The document ‘Keyboard2.html’ opens in the same
tab.
INSERTING AUDIO
You can add audio files to a web page to add background music or provide a song or spoken-word
performance that visitors can play. HTML5 provides the <audio> tag to add audio file to a web page.
Audio <audio> Tag
The <audio> tag is an empty tag. The various attributes of the <audio> tag are given in the table.
Attribute Description Value(s)
src Specifies the URL of the audio file. URL
height Plays the audio file automatically as the web page loads in the web browser. autoplay
controls Displays controls in the web page to control the audio playback. controls
loop Replays the audio file once it has finished playing. loop
INSERTING VIDEO
You can add video files to a web page to provide visitors with an extra way of assessing the information.
HTML5 provides the <video> tag to insert a video file in a web page.
Video <video> Tag
The <video> tag is an empty tag. The various attributes of the <video> tag are described below.
Attribute Description Value(s)
src Specifies the URL of the audio file. URL
height Specifies the height of the video player in a web page. value in pixels
width Specifies the width of the video player in a web page. value in pixels
autoplay Plays the video file automatically as the web page loads in the web autoplay
browser.
controls Displays controls in the web page to control the video playback. Controls
59