HTML Elements
HTML consists of elements which are defined by tags. There is an easy confusion as most people think that the tags are the same with the Elements.
An Element consists of two things: a tag and its content.
For example:
Hi my name is Tom.
So, in short, anything between an opening and a closing tag is an HTML element.
There are also elements which do not necessarily have a closing tag and they also are considered HTML Elements, they are known as "empty" Elements:
,
,
Nested HTML Elements
A nested element is an element that contains another element.
For example below we have a div element containing the h1 and p elements:
My Heading
This is my paragraph
What are Block-level and Inline HTML Elements?
There are elements which when used form a block and start a new line, these are the Block Elements. Other Elements do not form a block and do not start a new line, these are the Inline Elements.
For example:
My Heading
This is my Inline Elementinside the paragraph
The Block level HTML elements are:
, to ,
, ,