HTML Elements

If You have to learn how to make websites then first you will have to know about HTML. So let's know what is HTML -

HTML

HTML stands for Hypertext markup language. This is the standard markup language for creating web pages. It describes the structure of a web page or we can say the skeleton of web pages It consists of a series of elements.

You can use any text editor to write the HTML code, such as Notepad (PC) or TextEdit (Mac). But Most of the programmers use a Visual Studio text editor.

Structure of HTML :-

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="style/style.css">
    <title>This is a Title</title>
</head>
<body>
     <h1>This is a heading</h1>
     <p>This is a paragraph</p>
</body>
</html>

HTML Elements

Now come to the point, What are HTML Elements? HTML Elements tells the browser how to display content. HTML elements are created with tags. It is defined by a start tag and an end tag and between these tags there is content. HTML elements label pieces of content such as "this is a heading", "this is a paragraph", "this is a link", etc. Some HTML elements represent visible components on a web page, such as text, images, or buttons, while others denote different sections of the page or provide meta information about the document. Some HTML elements that don't have an end tag are called empty elements. Now Let's see some tags :

Basic HTML Tags:

<html>: This is the root element of an HTML element. 
<head>: This is a container for metadata. It is placed between the <html> tag
        and the <body> tag.
<link>: It defines the relationship between a document and external resources.
<title>: It defines the title of a document.
<body>: It defines the document's body. and is a container for all the visible 
        contents, such as headings, paragraphs, images, audio, videos, hyperlinks,
        tables, lists, etc.

Heading Tags :

The HTML heading tag is used to define the heading of the HTML document.

The <h1> tag defines the most important tag, and <h6> defines the least 
important heading.
Example :
<h1>This  is heading 1 </h1>
<h2>This  is heading 2</h2>
<h3>This  is heading 3</h3>
<h4>This  is heading 4</h4>
<h5>This  is heading 5</h5>
<h6>This  is heading 6</h6>

Paragraph Tag :

A paragraph always starts on a new line and is usually a block of text.

HTML paragraph defined with the <p> tag.
Example :
<p> This is a paragraph </p>
<p> This is another paragraph </p>

The HTML anchor tag defines a hyperlink that links one page to another page.

HTML links are defined with the <a> tag.
Example :
<a href="https://www.ineuron.ai"></a>
href - It means Hypertext Reference. which indicates the link's destination.

Image Tag :

The <img> tag is used to embed an image in an HTML page. This is a self-closing 
tag, which means this tag has no end tag.
<img src="" >
src - This is an attribute. It specifies the path to the image to be displayed 
on a web page.

The Table Tag :

The <table> tag is used to create a table in the HTML document.
The table can be created by using <th>, <td>, and <tr> tags.

The <th> tag defines a heading for the table.
The <td> tag specifies the table data cells which are used to make the column.
The <tr> tag specifies the table rows which is used to make a row.


<table>
<thead>
<tr>
<th>Serial no.</th>
<th>Name</th>
<th>Amount</th>
</tr>
</thead>

<tr>
<td>1</td>
<td>Sahil</td>
<td>2000</td>
</tr>

<tr>
<td>2</td>
<td>Vikash</td>
<td>1500</td>
</tr>

</table>

Output -: Table.img.jpg

HTML Formatting Elements :

<b> : Bold Text
<strong> : Important Text
<i> : Italic Text
<em> : Emphasized Text
<mark> : Marked Text (Highlighted text)
<small> : Smaller text
<sub> : Subscript text
<sup> : Superscript text
<q> : Quotation mark
<blockquote> : Defines a section that is quoted from another source.
<cite> : Defines the title of a work.
<address> : Defines contact information for the author of a document.
<ins> : Inserted text (Underline text)
<del> : Deleted text

Empty Elements :

<br> : The HTML <br> element defines a line break.
<hr> : The HTML <hr> tag is used for creating a horizontal line.

<meta> , <link> and <img> are also empty elements.