HTML component
An end tag, some content, and a start tag make up an HTML element.

HTML Components


An end tag, some content, and a start tag make up an HTML element.

Example:

<html_tagname> Content is placed here…. </html_tagname>

Several HTML components are examples:

Example:

<h1>My Initial Heading</h1>
<p>My Initial paragraph.</p>


Note that some HTML elements, such as the
<br> element, are empty. These
are referred to as empty elements. Elements that are empty lack an end
tag.

HTML Nested Elements



Elements in HTML can be nested (this means that elements can contain other
elements).
Nested HTML elements are present in every HTML document.

Four HTML elements are used in the sample below (<html>, <body>,
<h1>, and
<p>):


Example:

<!DOCTYPE html>

<html>

<body>
   <h1>My initial Heading</h1>
   <p>My initial paragraph.</p>
</body>

</html>

Explained Example



The root element of an HTML document is the
<html> tag, which defines the
whole HTML document.
Both the start and end tags are in the html format.

The <body> element is then
contained within the
<html> element:


Example:

<body>
  <h1>My initial Heading</h1>
  <p>My initial paragraph.</p>
</body>


The body of the document is defined by the
<body> element.

It has a <body> tag at the
beginning and a </body> tag at
the conclusion.

Then, two additional elements
<h1> and
<p> are contained within the
<body> element.


Example:

<h1>My initial Heading</h1>
<p>My initial paragraph.</p>

A heading is defined using the <h1> element.

It has an opening <h1> tag and a
closing </h1> tag.


Example:

<h1>My initial Heading</h1>


The paragraph is defined by the
<p> element.

Its start and end tags are p and
</p>, respectively:


Example:

<p>My initial paragraph.</p>

HTML Empty Elements


Empty HTML elements are those that have no content.

The <br> tag, which is an empty
element without a closing tag, defines a line break:
<p> There is a line break
<br> in this paragraph.
</p>

HTML Does Not Care About Case



HTML tags are not case-sensitive, so
<P> and
<p> have the same meaning.

Although lowercase tags are not required by the HTML standard, the W3C
advises using them and requires them for more stringent document formats
like XHTML.
Rate this post

Categorized in: