HTML Elements

  • Each element consists of an opening tag, associated content, and an end tag, which contains the designated content for display on the web page. For example, the element <p> represents a paragraph, while <h1> indicates a basic level heading.

    Basic HTML Elements

    Headings: Headings represent the hierarchical structure of content on a web page, ranging from <h1> (most important) to <h6> (least important).
    Paragraphs: Paragraphs enclose the textual content on a web page.
    Lists: Lists organize information in an organized or unordered fashion.

    Example

    HTML

    Self Closing Elements

    There is no closing tag in Self-closing elements. This is because they have no content. They are empty elements. Following are some examples of self-closing elements.

    <img>: Images are embedded in a website page with the <img> element.
    <br>: The line break element, <br> is used to add a single line break in content.
    <hr>: This horizontal rule element creates a visual separation between content sections.
    <input>: To create form input fields, an input element is used.
    <meta>: This element contains metadata about the HTML document, such as character encoding.

    Example

    HTML

    Nested Elements

    Nested elements in HTML refer to elements that are contained within other elements. This hierarchical structure allows for the structuring of content on a web page.

    Example

    HTML

    In the above example, the inner <div> is nested inside the outer <div>. This nesting allows for grouping related content and applying styles or functionality to the nested elements as a unit.

    HTML

    Tables in HTML often have nested elements such as <tr> (table rows) and <td> (table data cells) within the <table> element to structure tabular data.

  • Watch Video on YouTube

    HTML Elements

  • HTML
    CSS
    JS
  • Ad #1
    Ad #2
    Scroll to Top