HTML Elements is a HTML Document component or one of HTML node. An Element is started with start tag and end with end tags with some content in between. Although there are some tags which are self closing or do not have closing tag.
Some Examples of HTML Elements:
|Element Start Tag||Element End Tag||Element Description|
|<div>||</div>||The <div> tag defines a division or a section in an HTML|
|<form>||</form>||Form tags is HTML used to design forms|
|<input>||</input>||Used to take input fromuser in various forms|
HTML Element Can contain other HTML Element.
HTML Documents contains nested HTML Element.
Best Example for that is
<body> tag and its content which consists of various tags.
HTML Nested Elements Example Given Below:
<!DOCTYPE html><html><body><h1>Picallens</h1><div><!-- This is Nested Element --><p>This is picallens Nested</p></div></body></html>
Non Void Element is HTML Element which have end tag to indicate the end of the element.
It is important to add closing or end tag of the element. It may or may not lead to incorrect result displayed on browser. Now days browsers are becoming much advanced that they can add end tags automatically at the end of most non-void elements.
According to w3 document on HTML. A non-void element must have an end tag, unless the subsection for that element in this document HTML elements indicates that its end tag can be omitted.
Example for HTML Element with closing tag:
<!DOCTYPE html><html><body><h1>Picallens</h1><div><!-- This is Non Void Element --><p>This is picallens Non Void Element</div></body></html>
Below is the example of chrome browser developer tools adding closing tag automatically at the end:
Elemnts which does not contains any content and does not have closing tag like line break. Sometime these tags are closed like
<br /> i.e, they are called void or self closing tags.
<p>Hi Welocome to <br> Picallens.</p>
<p>both are same.
HTML Element are basic building blocks of elemnt to provide web page a structure, we are going to see multiple elements along this tutorial. In next tutorial we are going to learn about HTML Attributes. Thanks for your Support!