Header Ads Widget

ad728

HTML Elements

HTML Elements

HTML Elements

HTML Elements

HTML Elements

An HTML element usually consists of a start tag and end tag, with the content inserted in between

The HTML element is everything from the start tag to the end tag

HTML documents consists of a tree of these elements and they specify how HTML documents should be built, and what kind of content should be placed in what part of an HTML document

Start tag Element content End tag
<h1> My First Heading </h1>
<p> My first paragraph. </p>
<br>    

HTML-Tags Vs Elements.

Technically, an HTML element is the collection of start tag, its attributes, an end tag and everything in between. On the other hand an HTML tag (either opening or closing) is used to mark the start or end of an element, as you can see in the above illustration.

The summary element

Nested HTML Elements

Nested HTML Elements

Nested HTML Elements

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

All HTML documents consist of nested HTML elements.

Example

This example contains four HTML elements

<!DOCTYPE html>
<html>
  <body>
  
    <h1>My First Heading </h1>
    <p>My first paragraph.<p>

  </body>
</html>

HTML Document Output

My First Heading

My first paragraph.

0 Comments: