Class 8 CH 9 Images and Links in HTML5
Class 8 CH 9 Images and Links in HTML5
1. Images can be added to the document with the help of <img> tag.
2. The alt attribute lets you specify text as an alternate to the image.
3. Hyper linking is the process to link various web pages together.
4. When one part of a web page is linked to another section of the same page is called
internal linking.
5. To align an image to top, bottom, or middle, the CSS property vertical-align is used.
1. The ______ attribute of <A> tag defines the document to which the link leads.
3. The _______ property is used to align an image to the right or left of the text.
4. The _______ attribute of <audio> tag plays the audio file automatically when the web page is
loaded.
1. Name the tag which inserts an inline image on the web page.
Ans. <img> tag.
2. Name the attribute of <img> tag that specifies the text as an alternative to the image.
Ans. Alt attribute.
4. Which attribute of <a> tag defines the document to which the link leads?
Ans. <href> attribute.
5. Name the attribute of <video> tag that plays the video file automatically when the web page
is loaded.
Ans. Autoplay attribute.
1. How are images added in an HTML document? What are the different attributes of an
image element?
Ans. The <img> tag is used to add images in an HTML webpage. It is an empty tag and
requires different attributes to be specified with it. The different attributes of <img> tag are-
src, alt, height, width, etc.
2. What is the importance of associating an alternate text with an image?
Ans. The Alt attribute displays text as an alternative to the image. Sometimes, a browser on the
user’s computer does not display images due to some reasons (maybe because of slow
connection or error in the src attribute). In that case, you can display the text to describe the
image. The only purpose of ALT attribute is to describe the contents of an image file. It is
generally used in case the user has a text – based browser on his computer, such as Lynx. It
also proves to be useful when the user is a blind surfer for whom the browser is programmed to
read aloud the alternative text browsers or user settings that do not support automatic loading
of images. In such cases as well, the ALT attribute is used.
3. How can you link webpages in HTML? What are the different types of linking?
Ans. In HTML, the anchor tag <A>, is used to mark the text as hyperlink, which a user can
click to display the webpage or website anchored to it. There are two types of linking:
Internal linking and External Linking.
When one part of a webpage is linked with another section on the same page, it is called the
Internal Linking, whereas, when one page is linked with another web page or website, it is
called the External Linking.
4. Explain with the help of code, how audio clips can be added in an HTML document.
Ans. We can use <audio> tag to insert an audio file in a web page. The following code
demonstrates the use of <audio> tag.
<html>
<head>
<title> Adding Audio Clip </title>
<style type=”text/css”>
Body{background-color:RGB(250,214,229)}
</style>
</head>
<body>
<h3 style=color:blue> Music gives soul to the Universe, wings to the mind, flight to the
imagination, and life to everything. <h3>
<audio controls src= “C:\users\lenovo\desktop\National Anthem.mp3”>
Your browser does not support the audio tag.
</audio></body>
</html>
5. Discuss the purpose of any two attributes of video tag.
Ans. Attributes associated with the <video> tag are given below:
a. Src- Specifies the URL of the video file.
b. Controls – Displays the controls on the web page.