Elements in HTML

In this article we will learn in details about HTML Elements. As we learned earlier, HTML is a language of setting up a HTML page. In this language, we have tags which are used to open a way of presentation and then there is a closing tag which closes the way presentation for a part of the web page.

These opening and closing tags, and only the opening tags for some of the expressions are known as HTML elements.
So here we can see that “elements” are also called as “starting tags” and “ending tags” and can also be called as opening tags and “closing tags”.

The following are some examples of HTML Elements: –
To express a Paragraph
Start Tag – <p>
End Tag – </p>

To express a link
Start Tag – <a href=”link.html”>
End Tag – </a>

To enter a new line
<br />

Thus, we have seen, 
A HTML element starts with a Start Tag, also known as Opening Tag.
Such an HTML Element closes with a Eng tag, also known as Closing Tag. For some expressions, there is no closing tag, meaning the opening tag ends in itself.
The element content is all of the content which is present in between the opening and closing tags.
SOme of the HTML elements may be empty content elements. Such elements do not have a closing tags and they end in themselves. Another interesting fact about HTML elements is that they also have attributes. Attributes are used to alter the work of the HTML elements by certain additions. By the attributes, the basic function of the HTML tag remains the same, but they will function slightly differently.

For example, The <a href=”link.htm”>Click here</a> tag, puts up a link on the words “Click here”. When you click on “Click here”, then the link will open in the same page. Now if we add target=”_blank” in the link tag : – <a href=”link.htm” target=”_blank”>Click here</a>, then it will make the link to open in a New page or a new tab.

HTML tags can be put before the closing of previously opened HTML tag. Such inclusion of HTML tags in previously opened HTML tags is called as nesting of HTML tags and thus, such elements are known as Nested HTML Elements. The <html> tag and <body> tags are used to nest other HTML tags in them.

HTML Tolerance
Some tags like the paragraph tags will display correctly, even if they are not closed.
<p>This is a paragraph
<p>This is a paragraph
This will still work correctly, but as browsers advance, improper closure of HTML tags can result into unexpected results and errors on the page.

HTML does not worry you about using lowercase tags and uppercase tags. Both produce the same effect. But the later versions of HTML, demand for lowercase use in the tags.

%d bloggers like this: