Educational

HSLC Computer Science Solution: Chapter 4 (Links and Frames in HTML)

Contents:

 

 

  • Objective Type Questions:

1. Fill in the blanks:

a. …………………… tie the web pages together in a website.
ans: Links

b. When you move the mouse pointer over a link, the mouse pointer changes its shape from an arrow to a ……………………
ans: small hand

c. If you want to create an e-mail link, …………………… is required before the address.
ans: ‘mailto:’

d. An anchor or a bookmark in an HTML document is created using the …………………… attribute.
ans: href

e. The default standard link color is ……………………
ans: blue

f. By default, links open in …………………… window
ans: current

g. The _blank value of the …………………… attribute opens the linked document in a new browser window or a new tab.
ans: target

h. To turn an image into a hyperlink, place the image source using the …………………… tag between <a> and </a> tags.
ans: <img>

i. The value of the height attribute is assigned in terms of ……………………
ans: pixels

j. The …………………… attribute of the <audio> tag indicates that you can replay the audio file once it is finished.
ans: loop

2. True and False

a. Only a single word can be set as hyperlink.
ans: False

b. The <a> tag is a container element.
ans: True

c. You cannot create a link within the same web page.
ans: False

d. An image can be set as hyperlink.
ans: True

e. The default active link color is red.
ans: False

f. The href attribute specifies where to open the linked document.
ans: True

g. You can also use the align attribute with the image tag.
ans: True

h. Frames allow us to open more than one web page simultaneously in a browser window.
ans: True

i. You cannot change the link colors.
ans: False

 

3. Choose the correct option.</a

a. A …………………… is a word, a group of words, or an image that can be used to jump to another document on the same website or another website.
i. hyperlink
ii. URL
iii. address
iv. none of these

ans: i. hyperlink

b. Which of the following can be set as hyperlink?
i. Single word
ii. Group of words
iii. Image
iv.All of these

ans: iv.All of these

c. The …………………… attribute of the <a> tag is used to set the URL of the target resource.
i. src
ii.href
iii. controls
iv. none of these

ans: ii.href

d. The …………………… sign lets the browser know that the destination is a named anchor within the current web page.
i. @
ii. &
iii. #
iv. none of these

ans: iii. #

e. The …………………… value of the target attribute opens the linked document in the same frame.
i. _parent
ii. _self
iii. _top
iv. none of these

ans: i. _self

f. Which of the following are the attributes of the <iframe> tag?
i. Src
ii. Width
iii. Height
iv.All of these

ans: iv.All of these

g. Which of the following can be embedded in a web page?
i. Audio
ii. Video
iii.Both (i) and (ii)
iv. None of these

ans: iii.Both (i) and (ii)

h. The attribute of the <audio> tag that displays controls on the web page is
i. controls
ii. autoplay
iii. loop
iv. none of these

ans: i. controls

i. Which/of the following specifies the color of a link when it is clicked?
i. Active
ii. Visited
iii. Hover
iv. None of these

ans: i. Active

j. The …………………… attribute of the <video> tag plays the video file automatically on loading a web page.
i. controls
ii. autoplay
iii. height
iv. none of these

ans: ii. autoplay

  • Descriptive Type Questions

1. Short Answer Questions

a. How are links indicated on a web page?

ans: Links are generally indicated by an underlined text and appear in a different color usuall blue or purple depending on whether the link object has been visited or not, If a link includes an image, the border of image will also appear,as blue or purple, unless its attribute is set to zero.

b. What does the term URL stand for?

ans: The term URL stands for Uniform Resource Locators

c. Name the tag used to create a link. Is it a container element or an empty element?

ans: The HTML tag that we use to create a link is called the anchor tag <a>. This tag is a container element as it has an ON tag <a> and an OFF tag </a>.

d. What happens to the shape of the mouse pointer when it moves over a hyperlink?

ans: When we move the mouse pointer over a link, the mouse pointer changes its shape from an arrow to a small hand

e. What are the default visited and active link colors?

ans: The default visited link color is purple and the default active link color is red.

f. Name the attribute of the anchor tag that specifies where to open the linked document.

ans: The target attribute of the anchor tag specifies where to open the linked document.

g. Which tag is used to define an inline frame in an HTML5 document?

ans: <iframe> tag is used to define an inline frame in an HTML5 document.

h. What is the use of the src attribute of the <iframe> tag?

ans: src attribute of the <iframe> tag specifies the URL of the web page to be displayed in the frame.

i. Name the tag used to embed an audio file on a web page. Mention any two attributes of this tag.

ans: The <audio> tag is used to embed an audio file on a web page. Two attributes of this tag are autoplay and src.

j. Name the tag used to insert a video file in an HTML5 document.

ans: The <video> tag is used to insert a video file in an HTML5 document.

2. Long answer questions

a. What is the use of hyperlinks? Name the different kinds of hyperlinks.

ans: Hyperlinks, or simply links, are the most important part of the World Wide Web. Links tie web pages together in a website or across various websites.
There are three different kinds of links:
• Internal: A link to a different section of the current document
• Local: A link to another page on the same website
• Global: A link to a page on a different website

b. What is the use of the href attribute of the <a> tag? Give an example.

ans: The href (hypertext reference) attribute of the <a> tag is used to set the URL of the target resource, which is the address of the document to link to. The href attribute of the anchor tag specifies the destination page or file.
For Example: <a href=”filename.html”>Next Page</a> (markings required)

c. What is the purpose of the target attribute of the anchor tag?

ans: By default, links open in the current window. If we want the link to open in another window, we need to add a target. The target attribute specifies where to open the linked document.
For example: <a href = “http://www.sebaonline.org” target = “blank”>SEBA</a> This will open the linked page in a new browser window or a new tab.

d. Mention the different values that can be assigned to the target attribute of the <a> tag?

ans: The different values that can be assigned to the target attribute of the <a> tag are:
(a)_blank
(b)_parent
(c)_self
(d)_top

 

e. Can you turn an image into a hyperlink? Explain with an example.

ans: Yes, we can turn an image into a hyperlink. For this, we can simply place the image source using the <img> tag, between <a> and </a> tags.
For example: <a href=”myschool.html”><img src=”school.gif”></a>

f. What is the use of creating frames in a web page?

ans: Frames allow us to open more than one web page simultaneously in a web browser window. Frames divide the screen into rectangular areas, each of which contain an HTML document.

g. What is the use of the height and width attributes of the <iframe> tag?

ans: The height attribute specifies the height of the inline frame. The width attribute specifies the width of the inline frame.

h. What is the purpose of autoplay and controls properties of the <audio> tag?

ans: The autoplay attribute plays the audio file automatically when the web page is loaded. The control attribute displays the controls on the web page.

i. Explain the use of embed tag in an HTML5 document. Mention any three attributes of this tag.

ans: We can add an audio or video file to an HTML5 document using the <embed> tag. Three attributes of this tag are: src, height and width.

j. Differentiate between <audio> and <video> tags.

ans:

<audio> tag

<video> tag

1.

It specifies a standard way to embed an audio file in a web page

It is used to insert a video file in an HTML document.

2.

It has the loop attribute to replay the audio file once it has finished playing

It does not have the loop attribute.

3.

It does not have the height and width attribute.

It has the height and width attribute

 

  • Application-based Questions

1. Observe the following HTML5 code and answer the questions that follow:

<!DOCTYPE html>
<html>
<head>
<title>Inserting Sound File</title>
</head>
<body>
<h2>Having Fun and Listening to music</h2>
<audio controls=”controls” src=”mysong.mp3″>
</body>
</html>

a. Which type of file has been inserted in this HTML5 document? Which tag has been used for this purpose?
ans: An audio file has been inserted in this HTML5 document. The <audio> tag has been used for this purpose.

b. What is the use of the src attribute?
ans:

The src attribute specifies the URL of the video to be played.

c. What change will you make in the above code, if you want to replay the audio file once it is finished?
ans: We will add the loop attribute in the above code to replay the audio file once it is finished.

2. Write an HTML5 code to assign green color to a link when it is clicked, orange color if the link has been visited, and purple color when the mouse is placed over it.

ans:

<!DOCTYPE html>
<html>
<head>
<title>Changing Link Colors</title>
<style type=”text/css”>
a:visited{color:orange;}
a:hover{color:purple;}
a:active{color:green;}
</style>
</head>
<body>
<a href=”http://www.google.com” target=”_blank”>This is a link</a>
</body>
</html>

3. Identify the error(s) in the following code and write the correct code.

<!DOCTYPE html>
<html>
<head>
<title>Creating Frames</title>
<style type=”text/css”›
iframe {margin-left: 40; border: 2px dotted orange;}
</style>
</head>
<body>
<h1>Creating Inline Frames</h1>
<iframe href=”firstframe.html” height=”300″ width=”200″>
<iframe href=”secondframe.html” height=”200″ width=”200″></iframe><br>
We have created two frames.
</body>
</html>

ans:

<!DOCTYPE html>
<html>
<head>
<title>Creating Frames</title>
<style type=”text/css”>
iframe {margin-left: 40px border:2px dotted orange;}
</style>
</head>
<body>
<h1>Creating Inline Frames</h1>
<iframe src=”firstframe.html” height=”300″ width=”200″></iframe>
<iframe src=”second.html” height=”300″ width=”200″></iframe>
<br> We have created two frames
</body>
</html>

4. Ishi’s school recently organised a cultural evening for the students. She has created a web page giving details about the event. She wants to add audio and video files to the web page. Which tags should she use to add audio and video to the HTML5 document?
ans: Ishi will use the <audio> and <video> tags to add audio and video to the HTML5 document.

5. Aman has used the <audio> tag to insert an audio file in an HTML5 document. He has used the loop attribute in this tag. What is the use of this attribute?
ans: The loop attribute indicates if the audio file should be replayed once it has finished playing.

 

Interested? Have any questions?

support@ujudebug.com

For more info Call us

+918011624355

View Comments

  • There is no level boundations made this all things in level vise such that class 1,2,3,4,5,6,7,8 and so on

Published by

Recent Posts

8 Best SaaS Tools for Startups & Small Businesses in 2025

More businesses are turning to SaaS tools to handle everyday tasks. Whether it's email, CRM…

5 days ago

Reasons to Start Using VPN as Marketing Tool

The success of your digital marketing strategy depends on hard work, the right metrics, and…

5 days ago

The Role of Markup Tools in Managing Cross-Platform Content Consistency

Maintaining consistency in content across multiple platforms is no small feat. Whether you’re managing a…

3 weeks ago

Best Practices for Writing Request for Proposal

Writing an influential request for proposal (RFP) is an essential step in the procurement process,…

3 weeks ago

Expert Guidance to Propel Your Brand’s New Offerings

Launching a new product in today’s dynamic market is no small feat. It requires strategic…

4 weeks ago

Social Media Marketing Services: Boosting Your Brand’s Online Presence

Social media marketing has become an important tool for businesses looking to expand their reach,…

4 weeks ago