What is HTML Tag or Element?

An HTML tag is a piece of markup language used to indicate the beginning and end of an HTML element in an HTML document.

Tag Description



Opening Tag :

The Tag Name which indicate the tag is started. There is lots of build in tags in html, for example

  • html

  • body

  • h1 to h6

  • p etc

Attribute & Value :

Attribute & Value is a key pair data where attribute is key & value is value, those are included inside the opening tag. there is 2 type of attributes, user defined means user can specify any types of attributes with value, there lots of build in attributes with values such as:

  • class

  • id

  • name

  • type

  • required etc

Other Tag or Content :

This section can contain other tags such as <div></div>, <span></span>, <p></p> etc, Or there can be some images, or text.

Closing Tag :

Most of tag has closing tag, It means that the tag ending. Some tag hasn’t closing tag such as img, br, hr input etc.

Tag Example

<section class="contact section" id="contact">
    <div class="content-block" data-name="custom-attribute">
        <ul class="content-block-ul rose-ul">
            <li class="content-block-ul-li"></li>