HTML Elements

By | December 31, 2019

HTML consist start tag and end tag.Inbetween start tag and end tag the content are inserted.

<tagname>Content goes here….</tagname>

Example 1:-

<h1>This is My First Heading.</h1>

In above mention example <h1> is start tag and </h1> is end tag and “This is My First Heading” is content.

Example 2:-

<p>This is paragraph.</p>

In above mention example <p> is start tag and </p> is end tag and “This is paragraph” is content.

HTML element with no content..are called empty element.In empty element there is no end tag they have only start tag.

Example:-<br>This tag are use for line break.

HTML elements can be nested(elements can contain elements).

Some Example:-

<!DOCTYPE html>
<html>
    <head>
        <title>Title</title>
    </head>
    <body>
        <h1>This is My First Heading.</h1>
        <p>This is My First paragraph.</p>
        <span>This is <br> span tag.</span>
    </body>
</html>

In the above example <h1> is a start tag and </h1> is a end tag. In HTML tag and attribute names are not case-sensitive. In the given example <html> element whole defines document. start tag <html> and end tag </html>. <body> elements are inside the <html> element. <body> element defines the document of the body.

start tag <body> and end tag </body>

There are three other elements inside <body> Element, <h1>, <p> and <span>.

The <h1> element defines the heading. In the middle of it is “This is My First Heading.” which is the content. start tag <h1> and end tag </h1>.

The <p> element defines the paragraph. In the middle of it is “This is My First paragraph .” which is the content. start tag <p> and end tag </p>.

HTML elements with no content are called empty elements. Example:-<br>This tag are use for line break.

There are two main types of HTML elements

  1. Block-level element:- The elements that divide the main parts of web page into block are called Block-level elements. Example:-

2. Inline element:- Inline elements are those which separate the parts of a given element. They are used mostly with other elements. Example:-

<a>, <abbr>, <object>, <b>, <bdo>, <code>, <cite>, <input>, <img>, <time>, <sup>, <sub>, <label>, <map>, <tt>, <var>, <samp>, <br>, <script>, <textarea>

Spread the love

Leave a Reply

Your email address will not be published. Required fields are marked *