Elements


HTML element is the building of a web page and it is important to understand how it is written. Generally, it has an opening and a closing tag. Any content is placed between the opening and the closing tags.

 

Syntax

The basic HTML element comprises of everything from the opening to the closing tag.


<tagname>content...</tagname>


Examples

<h2> Welcome to Chase bank </h2>
<p>
I have an account with Amazon</p>
<title>
Colevate Tech Tutorials</title>
<h3>
Run codes <br> Here on Colevate</h3>


HTML Elements Nesting

Looking at the examples above, it is not how HTML code is written or limited to. One tag can be embedded into another or into multiple tags. In the example HTML code below, multiple tags will be nested starting from <html>, <head>, <title> and other HTML tags.

 

Example

<!DOCTYPE html>
<html>
<head>
    <title> Colevate HTML Tutorial </title>
</head>
<body>
    <h1> Microsoft Sales Team </h1>
    <p> Alibaba Marketing Department </p>
</body>
</html>

 

Tips: Not all HTML tags have open and close tag pairs