
HTML elements are consist of are starting tag and an ending tag. All the content between the tags is considered as the part of that element. For example:
<p> this is a paragraph </p>
<h1> this is a heading </h1>
There are some HTML tags which does not have ending tags and we will discuss these tags further.
Nested Elements
In HTML 5 you can use tags in a nested form like tags within the tags elements within the elements. For example:The HTML tag define HTML language hands all the text within this element will be called as nested. Same is the case with body and header tags and many many more.
<html>
<body>
<h1>Nested Elements Example</h1>
</body>
</html>
Common Mistake
The most common mistake people make in nested elements is there they forget to end the tags. For example if the H1 tag is open and you write a paragraph within, it will be considered as heading and many time the people find it hard to debug it. The best protest is to write starting and ending tags together so that you will never forget to close a HTML tag.
Single or Empty Tags
In HTML5 most of the text contain a starting and ending tag but there are some rare cases where the HTML tag is single or just a starting tag. These elements are called empty elements. For example the <br> tag is used to break a line which does not contain and ending tag. Remember this type that does not need ending tags and if you do so it will be considered mistake in HTML5.
Note:
all the html tags are not case sensitive. Both <P> and <p> will work in a same way. The HTML 5 standards say that if you use lower case letters then the upper case letters will be more effective in a way of reading but still you can use upper case if you want.
No comments:
Post a Comment