HTML

 Book's exercise Page number-

2. Short Answer Questions

 a) Define tag. Differentiate between paired tag and singular tag with examples

HTML tag is a special keyword enclosed within angle brackets (< >) used to define and format content in a web page. Tags instruct the browser how to display text, images, links, tables, etc.

Paired tags consist of an opening tag and a closing tag. The opening tag starts the element and the closing tag ends it. Example: <p>Paragraph</p>, <b>Bold</b>.

Singular tags (also called empty tags) do not have a closing tag. They perform a single function. Example: <br> (line break), <hr> (horizontal line), <img>.

 

 b) What is attributes? Explain

Attributes are used to provide additional information about HTML elements. They define properties such as color, size, alignment, source, and links. Attributes are always written inside the opening tag.

Attributes usually appear as name-value pairs. Example:

html

<img src="photo.jpg" width="200" height="150">

 

 c) Explain structure of HTML with example

The basic structure of an HTML document consists of three main parts: <html>, <head>, and <body>.

 

 <html>: Root element that contains the entire HTML document

 <head>: Contains meta information like title

 <body>: Contains visible content of the web page

 

Example:

<html>

<head>

<title>My Web Page</title>

</head>

<body>

<h1>Welcome</h1>

<p>This is a web page.</p>

</body>

</html>

 

 d) How is the FONT tag used? What are its attributes?

The <font> tag is used to change the font size, color, and face of text. It is mostly used in older versions of HTML.

Attributes of <font> tag:

 size: Changes the size of text

 color: Changes the color of text

 face: Changes the font style

Example:

html

<font size="4" color="blue" face="Arial">Hello</font>

 

e) Name the tags for breaking paragraph and line

HTML provides different tags for breaking text.

 <p> tag is used to create a new paragraph and adds space before and after the text.

 <br> tag is used to break a line and move the text to the next line without adding extra space.

Example:

<p>This is a paragraph</p>

Line one<br>Line two

 

 f) What are the different types of lists used in HTML?

HTML supports three types of lists:

1. Unordered List (<ul>) – Displays items with bullets

2. Ordered List (<ol>) – Displays items with numbers or letters

 

Example:

<ul>

<li>Apple

<li>Orange

<li>Mango

</ul>

<ol>

<li>First

<li>Second

<li>Third

</ol>

 

  g) What is hyperlink? Give example

A hyperlink is a clickable text or image that connects one web page to another page, file, or location. Hyperlinks are created using the <a> (anchor) tag.

Hyperlinks help in navigation between web pages and websites.

Example:

<a href="https://www.example.com">Visit Site</a>

 

h) What is the use of intra page links? Illustrate with examples

An intra-page link is used to navigate to different sections within the same web page. It is useful for long web pages like FAQs and manuals.

It uses the id attribute to identify locations.

Example:

<a href="section1">Go to Section 1</a>

<h2 id="section1">Section 1</h2>

<p>Content here</p>

 

 i) Is it possible to insert image to the web page? If yes, then how?

Yes, images can be inserted into a web page using the <img> tag. The <img> tag is a singular tag and requires the src attribute.

Common attributes:

 src: Image location

 alt: Alternative text

 width and height: Image size

 

Example:

<img src="flower.jpg" alt="Flower" width="200">

 

 j) What are the main HTML tags used in <TABLE> tags?

HTML tables are created using several tags:

 <table>: Defines the table

 <tr>: Defines a table row

 <th>: Defines table heading

 <td>: Defines table data

 

Example:

<table>

<tr><th>Name</th><th>Age</th></tr>

<tr><td>Ana</td><td>20</td></tr>

</table>

 

 k) What is centre tag? Give examples

The <center> tag is used to align text or elements to the center of a web page.

Example:

<center>

<h1>Welcome</h1>

</center>

 

 l) What are the types of text input used on forms? Explain in brief

HTML forms use different text input types to collect user data.

 

Common types:

 text: For normal text input

 password: Hides typed characters

 email: Accepts email format

 number: Accepts numbers only

 

Example:

<input type="text">

<input type="password">

<input type="email">

 

3.Write the purposes and syntaxes of the following HTML tags:

 a) <P>

Purpose: Used to define a paragraph of text.

Syntax: <p>This is a paragraph</p>

b) <SUB>

Purpose: Displays text as subscript (below normal text).

Syntax: H<sub>2</sub>O

c) <HR>

Purpose: Creates a horizontal line to separate content.

Syntax: <hr>

d) <A>

Purpose: Creates a hyperlink to another page or resource.

Syntax: <a href="url">Link text</a>

e) <TABLE>

Purpose: Used to create a table with rows and columns.

Syntax: <table>...</table>

f) <IMG>

Purpose: Displays an image on a web page.

Syntax: <img src="image.jpg" alt="image">

g) <B>

Purpose: Makes text bold.

Syntax: <b>Bold text</b>

h) <PRE>

Purpose: Displays text exactly as written (preserves spaces).

Syntax: <pre>Text here</pre>

i) <I>

Purpose: Displays text in italic style.

Syntax: <i>Italic text</i>

j) <FORM>

Purpose: Used to create an input form for user data.

Syntax: <form>...</form>

k) <UL>

Purpose: Creates an unordered (bulleted) list.

Syntax: <ul><li>Item</li></ul>

Popular posts from this blog

Computer

Sequential Programs