Page 56 - CA_165_V2.0_Flipbook
P. 56
Empty Tag
Empty tags are standalone tags which are not used in pair. Such tags do not have any ending tag and
indicate ‘one time’ instructions. Empty tags represent formatting constructs such as line breaks, inserting
images, etc.
These tags have only an ON tag. ‘ON’ tag refers to start tag and ‘OFF’ tag refers to close/end tag. The
empty tags do not act on block of text but they perform their task at the insertion point only. These tags
are also termed as singular tags. For example:
<HR> (It is used as single tag and it inserts a horizontal rule.)
<BR> (It is used as single tag for line break.)
Element
It refers to different sections that include opening or closing tag and the content within it. It is the
fundamental component of the structure of an HTML document that includes distinctive components
such as body, title, paragraph or list. Elements are similar to the tags, but we can say that all tags in one
section together with the text or attributes inside are referred to as elements.
An element has three parts:
a start tag
an end tag
content between start and end tags
For example:
<TITLE> My First Webpage </Title> Element: It is title element
Start tag Content End tag
(opening tag) (closing tag)
Here, <TITLE> is start tag and </TITLE> is end tag. "My First Webpage" represents content. This is an
example of title element.
Attribute
An attribute is a property that provides some additional information about a tag. It enhances the
functionality of a tag. It is always specified inside the opening tag. All attributes consist of two parts– a
name and a value.
The ‘name’ is the property that you want to set.
The ‘value’ is what you want for the respective property.
For example:
<BODY BGCOLOR="yellow">
The attribute BGCOLOR has the value yellow.
The BGCOLOR attribute of the <BODY> tag is used to add a background colour to the body of the web page.
54 Touchpad Computer Applications-X

