Chapter 5 HTML (HyperText Markup Language) Solutions
Question - 21 : - What is an attribute in HTML?
Answer - 21 : -
HTML attribute is a modifier of HTML element. Attributes provide additional information about HTML elements. Attributes are always specified in rhe start tag of an element, after the element’s name. These come in name/value pairs like name=”value”.
Syntax
(content to be modified by the tag)
Where, TAG is the HTML element, name is the name of an attribute, set to the provided value.
Question - 22 : - What is the purpose of using HTML tags and attributes for Web designing?
Answer - 22 : -
HTML (HyperText Markup Language) is used to create Web pages. It designs the basic layout and formatting of Web pages by using tags and attributes.
The tag’s name tells the tag’s purpose and the attributes that follow the tag name give the additional information of the Web browser.
Question - 23 : - Differentiate between container and empty elements used in HTML.
Answer - 23 : -
Container elements HTML container elements require a starting as well as an ending tags.
e-g , , .
They affect the text appearing between their starting and ending tags.
Empty elements HTML empty elements require just a starting tag and not an ending tag.
e.g.
![]()
,
,
.
They just carry out the job assigned to them.
Question - 24 : - Find the error(s) in the following code and underline those errors.
Example ...........
Answer - 24 : -
should be placed before
The correct code is
Example
Question - 25 : - What does tag in HTML contain? Write any two attributes used with this tag.
Answer - 25 : - The
tag encloses the main part of the document. It contains all the contents of a document. Various markup elements are allowed within the body to indicate heading, paragraphs, lists, hypertext links, images and so on. The tag uses various attributes such as background, bgcolor etc.
Question - 26 : - Which tag do we use to change the size and style (face) of the text of an HTML file viewed on a Web browser? Also, explain any two attributes used with this tag.
Answer - 26 : -
tag is used to change the size and style (face) of the text of an HTML file displayed on a Web browser. Two attributes of tag are as follows:
size: It specifies the size of the text inside a tag.
Syntax
face: It specifies the font name of the text inside a tag.
Syntax
Question - 27 : - Write the HTML code to set the bgcolor as pink, heading level 2, text This is pink background’ as black and topmargin 60.
Answer - 27 : -