HTML #2 - HTML Elements types and Clear Explanation
Hello friends, Welcome to the another tutorial of Programming Infinity. As we had started a new tutorial series of HTML, this is the 2nd tutorial of the HTML Programming Series. In this tutorial, we will get a clear introduction of elements, its uses and also about its types. So friends, let's begin..
ELEMENTS
In HTML, Elements are building blocks of HTML Code. Every pair of same tag like <p>..</p> is an element. we can understand it easily through an example that a fully-built house is a Web page and its bricks, which is the building blocks is the elements. It is represented using tags i.e. tags are the building blocks of Elements and is self descriptive like, if we want to define a paragraph,we use "p" tag, which can be easily understand as a paragraph. and In a house the cement mixture is called tags from the above example.
There are two types of elements :-
- Container Elements.
- Empty Elements.
CONTAINER ELEMENTS
<p>Hello!</p>
The elements which has a starting and ending tag are called a container elements. we will understand it by a example that a container elements is a box which can contain some thing. It has always a starting and ending tag to act as a container.
The elements which has only a ending tag are called an Empty elements. we will understand it by a example that container element is a box which can't contain any thing because is hollow. It has always a ending tag and doesn't contain any content within it.
EMPTY ELEMENTS
<br/>
<br>
<br>
The elements which has only a ending tag are called an Empty elements. we will understand it by a example that container element is a box which can't contain any thing because is hollow. It has always a ending tag and doesn't contain any content within it.
POINTS TO REMEMBER
- Always put a closing tag in any elements, otherwise it will cause error. In HTML5, some elements can be written without ending tag, but in other version of HTML, it will cause error. So, Remember not to forget closing tag of any element. As in container elements it is easy to put tags with only put a forward slash "/" before the tag as </p> , but for empty elements, we had to only write the closing tag, as it doesn't contain any content inside it like <br/>.
- As HTML is not a case sensitive language, so you can write it in any case, but It is recommended by programming infinity to write it in lower case. Code of programming infinity is also written in lower case.
So friends, that's all for this tutorial. Hope you like this tutorial. If you have any question, then ask me in comment box. I will try to answer it soon as possible.
Nice and short ☺️☺️☺️☺️☺️
ReplyDelete