HTML (Hyper Text Markup Language) Elements

A HTML segment is portrayed by a starting tag, some substance, and an end tag.

HTML Elements

The HTML component is everything from the beginning tag to the end tag:

<tagname> Content goes here…</tagname>

Instances of some HTML components:

<h1>My First Heading</h1>
<p>My first paragraph</p>
Start tagElement contentEnd tag
<h1>My First Heading</h1>
<p>My first paragraph.</p>
<br>nonenone
HTML

Nested HTML Elements

HTML components can be settled (this implies that components can contain different components).

All HTML archives comprise of settled HTML components.

The accompanying model contains four HTML components (<html><body><h1> and <p>):

Example

<!DOCTYPE html>
<html>
<body>

<h1>My First Heading</h1>
<p>My first paragraph.</p>

</body>
</html>

Example Explained

The <html> component is the root component and it characterizes the entire HTML report.

It has a start tag <html> and an end tag </html>.

Then, inside the <html> element there is a <body> element:<body>

<h1>My First Heading</h1>
<p>My first paragraph.</p>

</body>

The <body> element defines the document’s body.

It has a start tag <body> and an end tag </body>.

Then, inside the <body> element there are two other elements: <h1> and <p>:<h1>My First Heading</h1>
<p>My first paragraph.</p>

The <h1> element defines a heading.

It has a start tag <h1> and an end tag </h1>:<h1>My First Heading</h1>

The <p> element defines a paragraph.

It has a start tag <p> and an end tag </p>:<p>My first paragraph.</p>

HTML

Some HTML components will show effectively, regardless of whether you fail to remember the end tag:

Example

<html>
<body>

<p>This is a paragraph
<p>This is a paragraph

</body>
</html>

Notwithstanding, never depend on this! Sudden outcomes and blunders might happen in the event that you fail to remember the end tag!

Empty HTML Elements

HTML elements with have no content they elements are called empty elements.

The <br> tag defines a line break, and is an empty element without a closing tag:

Example

<p>This is a <br> paragraph with a line break.</p>

HTML is Not Case Sensitive

HTML tags are not case touchy: <P> means the same as <p>.

The HTML standard doesn’t need lowercase labels, however W3C suggests lowercase in HTML, and requests lowercase for stricter record types like XHTML.

At Example we always use lowercase tag names.

HTML Tag Reference

Model label reference contains extra data about these labels and their properties.

TagDescription
<html>Defines the root of an HTML document
<body>Defines the document’s body
<h1> to <h6>Defines HTML headings
HTML