Learn HTML For Beginners

What is Element

An element gives structure to a HTML document and tells the browser how you want your website to be presented. HTML documents are defined by HTML elements. An HTML element is everything from the start tag to the end tag. The start tag is often called the opening tag and the end tag is often called the closing tag. An HTML element starts with a start tag / opening tag. An HTML element ends with an end tag / closing tag. The element content is everything between the start and the end tag. Some HTML elements have empty content. Empty elements are closed in the start tag. Most HTML elements can be nested (can contain other HTML elements). HTML documents consist of nested HTML elements.

<html>
    <body>
        <p>
            This is a paragraph.
        </p>
    </body>
</html>

<p>, <body> and <html> are elements. In which <p> defines a paragraph in HTML document. The element has a start tag <p> and an end tag </p>. The element content is: This is a paragraph. The <body> element defines the body of the HTML document. The element has a start tag <body> and an end tag </body>. The element content is another HTML element. The <html> element defines the whole HTML document. The element has a start tag <html> and an end tag </html>. The element content is another HTML element.

Empty HTML Elements:

HTML elements with no content are called empty elements. <br> is an empty element without a closing tag (the <br> tag defines a line break).

;