Overview of HTML Elements – Structure, Types | Web Development | New Topic [2024]

Share To:

In this note, we are going to learn about HTML Elements, their structure and types as well. Welcome to Poly Notes Hub, a leading destination for engineering notes for diploma and degree engineering students.

Author Name: Arun Paul.

Overview of HTML Elements

An HTML element is a component of an HTML document that defines a structure or a section of material on a web page.

Every HTML element consist of:

  • Tags: The opening and closing tags specify where the element begins and ends.
  • Content: The information or nested items inside the tags.
  • Attribute: Additional information or settings for the element are included within the opening tag.

Structure of an HTML Elements

Structure of an HTML Elements - poly notes hub

It has main three part as shown on the above picture:

  1. Start Tag: In the above picture, we are using paragraph tag <p> as a start tag or opening tag.
  2. Content: “Welcome to Poly Notes Hub”, is the content between both of the tags, In between, <p>Content</p>.
  3. End Tag: The end tag is </p>

Types of HTML Elements

There are two types of HTML Elements:

  1. Block Elements: These elements cover the entire width of their parent container and always begin on a new line. For Example: <div>, <p>, <h1> etc.
  2. Inline Elements: These items take up only the appropriate width and do not begin with a new line. For Example: <a>, <span>, <img> etc.

Attributes of HTML Elements

Here are some basic attributes:

  • id, provides a unique id for an element.
  • class, sets one or more class names for an element.
  • style, used for inline css.
  • title, for additional information of the element.

Examples, that how to use attribute:

<a style="color: red"; class="link-class" id="link-id" title="Example Link">Welcome to Poly Notes Hub</a>
Share To:

Leave a Reply

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