An HTML file is made of elements.These elements are used for creating web pages and define content in that webpage. An element in HTML usually consist of a start tag,close tag and content inserted between them.
HTML Elements
Note: Some elements does not have end tag and content, these elements are termed as empty elements.
<p>This is a paragraph.</p>
Example
<DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>This is a H1 heading.</h1>
<p>This is a paragraph.</p>
</body>
</html>
Void element: All the elements in HTML do not require to have start tag and end tag, some elements does not have content and end tag such elements are known as Void elements or empty elements. These elements are also called as unpaired tag.
Nested HTML Elements: HTML can be nested, which means an element can contain another element.
HTML Block and inline Elements
- Every HTML Elements has their default own display and style value.
- There are two display values: block and inline.