basics of html coding

Basics of HTML Coding

As the very basics of HTML coding, HTML stands for HyperText Markup Language and is the most widely used language to create webpages of the websites. HTML is a Programming Language or not?

HyperText in HTML document means the text that links the document to another webpage. Using the HyperText is the way of linking several webpages together.

The markup language is a type of language in which text of the documents is marked-up using the various types of tags to tell the browsers how to display the document.

The Marking-up of text in the HTML simply means enclosing the texts of the document with different tags such as opening and closing tags to display it in a particular structure. For example, if we enclose  a particular text is inside <h1> tags then that text will become the heading in that document.

History of HTML

When learning the basics of HTML coding it is important to know the history of the HTML. It was developed in the year 1989, by Tim Berners Lee. It was developed as the Standard General Markup Language that is SGML. In the year 1991, CERN (European Organization for Nuclear Research) published its first HTML edition. As time evolved, many versions of HTML came to use. The latest version of HTML currently being used is HTML 5.0.

Other previous HTML versions:

  • The first version HTML was published in June 1993 as a recommendation of W3C.
  • HTML 2.0 was published in November 1995.
  • HTML 3.2 was published in January 1997.
  • HTML 4.0 was published in December 1997.
  • The latest version of HTML currently in use is HTML 5.

Basic HTML Document

A document consisting of all structured elements like head, title, body tags, etc. in the proper way is known in the HTML document. The simplest form of HTML document is given in the HTML codes below:

<!DOCTYPE html>
<html>
<head>
<title>This a title of the document</title>
</head>
<body>
<h1>This is the heading of the document</h2>
<p>This is the content of the document</p>
</body>
</html>

Output:

basic html document

HTML Tags

As we learned the basics of HTML coding now we know that the different types of tags are used to mark-up the text in an HTML document. The following are the basic HTML tags that are used in the HTML document to create a webpage.

<!DOCTYPE html> 

The <!DOCTYPE html> tag is used to declare the type of Document is that is HTML. In other words, it tells the web browser that the document is an HTML document

<html>

The <html> tag is used as an opening tag of the HTML document. As we know the basics of HTML coding, in the HTML document the majority of tags used to have both opening and closing tags. So, its the opening tag of the HTML document.

<head>

The <head>tag in HTML is used to give the heading of the document inside which the <title> lies.

<title>

The <title>is used to give the title to the HTML document. The title of the HTML document can be seen in the tabs of the web browsers and not inside the HTML document.

<body>

The <body>tag is used to create the body of the HTML webpage. All the visible contents of the webpage are written inside this tag only.

<h1>

Inside the body of an HTML document, the first thing written in the heading. This <h1>tag is used to write the heading of the webpage. Other than <h1>tag, there are five more heading tags viz. <h2>, <h3>, <h4>, <h5>, <h6>.

<p>

The <p>tag is used to create the paragraph in the document.

Creating the HTML Webpage (Step by Step)

To create the first web page in HTML, you need a text editor to write the HTML Codes. Any text editor, most commonly Notepad++ or sublime text editor can be used to write the HTML codes. So, let us create a web page using the basics of HTML coding step by step:

1. Open your sublime text editor:

sublime text editor

Text editors like Sublime and Notepad++ are used to write HTML codes and all other programming languages codes. You can download Notepad++ from here. If You want to download Sublime text editor you can click here. Both the text editors are free to download and use.

2. Write all HTML tags required to structure a document as shown in the image below:

html syntax

By writing the codes above, we have declared the Document type, written the HTML opening tag, gave the title to the document, and inside the body tag we have written the heading and paragraph tag. In this way, we have created our first HTML web page. However, this web page is very simple and would not please you much. it will look attractive when CSS will be added to this document. 

Now, the next step is to save the document file on the computer.

3. Save the written HTML document.

save html document

Save the HTML document file with any name in any of the folders of your computer. It is pertinent to note that HTML document files can be saved into two formats that are .html and .htm. In other words, the HTML document file can be saved using two file types that are written above.

4. Run the HTML to view in the browser

To run the HTML document file in your browser, you can double click on the HTML document file that you have saved and if your default browser is selected then it will be opened in your browser as your HTML web page.

html output

In this way, you have learned the basics of HTML coding and knew how to create a basic web page. To stylize the simple HTML web page that we have created can be done by using the other language that is CSS which stands for the Cascading Style Sheets.

More from this Blog:

Avatar

By Rahulwebdev

Hello! I am Rahul Raj. A tech blogger and an enthusiastic web developer. Sharing my skills through my blog. Keen to learn various Programming Languages. " Programming is Poetry".