HTML Basics


In this post, we will look at HTML Basics by knowing all of the fundamentals of HTML code. When we first start coding in HTML, we must evaluate and incorporate a number of tags. These tags assist with the grouping and basic formatting of items in our scripts or web pages. These step-by-step instructions will walk you through the HTML authoring process.

Basic HTML Document

The basic HTML tags listed below split the whole document into several sections such as the head, body, and so on.

A HTML document tag is the first thing that appears in any HTML document. Although it is not required, it is a good practice to begin the document with the tag listed below. For additional information about Doctypes, please see the HTML Doctypes article.

<html>: All HTML code must be contained by basic HTML tags. It starts with the <html> tag and concludes with the </html> tag.

<head>: The next tag is the head tag, which holds all of the header information of the web page or document, such as the page title and other information. This data is included within the head tag, which begins with <head> and ends with </head>. The contents of this tag will be described in the course's subsequent parts.

<title> : The title element is used to provide the title of a web page. This is header data, hence it is specified inside the header tags. The tag starts with <title> and finishes with </title>.

<body>: The following tag is the most crucial of all the tags we've learnt so far. The body element includes the page's actual body, which is accessible to all users. This begins with <body> and concludes with </body>.

Every piece of content included within this tag will be shown on the web page, whether it be text, photos, audio, video, or links. We'll see later in the tutorial how we might put the given items into our web pages by utilizing various tags.

Example

Preview

 This code will not provide any results. It just demonstrates the fundamental structure for writing HTML code and names the title of  the page. <! – – comment here – – > is an HTML <comment> tag that does not read the line contained within it


HTML Headings

These tags assist us in providing headers to the content of a webpage. These tags are often written within the body tag. From <h1> to <h6>, HTML offers us with six header tags. Each tag shows the header in a particular font style and size.

Example

Preview

HTML Paragraph

These tags assist us in writing paragraph on a website. They begin with the <p> tag and terminate with the </p> tag. The <br> element is used to break the line and functions as a carriage return in this case. <br> is an empty tag.

Example

Preview

HTML Horizontal Lines

The <hr> element is used to divide the page into sections, producing horizontal margins with the help of a horizontal line that runs from the left to right side of the page. This is also an empty tag that accepts no more statements.

Example

Preview

HTML Images

The image tag is used to include a picture on the website. The <img> <src="source of image"> element contains the source of the image to be placed.

Example

Preview