How to write a html code?

Introduction

Writing a code in HTML is easy. When I say HTML I mean HTML 5 which is the latest version of HTML. Before beginning let's know a little about HTML language. HTML stands for HyperText Markup Language as the name suggests it's a markup language, not a programming language because it does not have a logical aspect. HTML forms the basic structure of every website we see over the internet. That's all for the introduction. Let us begin then.

Structure of an HTML code

 

Structure of an HTML code
Structure of an HTML code

Writing a HTML code

So what tools we require? We do not need anything special for writing code in HTML.

If you're on a Windows platform you can use Notepad to write your code and if you're on Mac OS you can go for TextEdit. These are the basic tools that are preloaded on these platforms. Otherwise, you can use Sublime text (paid), VS studio code(free), Atom(free), etc. These are text editors to write and edit your code. 

I have given the download links at the end of this blog.

I would suggest not to use Microsoft Word or other rich text editors for writing your code :)

Source code used in this example:


<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>HTML code example</title>
</head>

<body>
  <h1>Sample Page</h1>
          <p>Hello World! LOL</p>
</body>

</html>

 

 Steps for writing your code in HTML. (Most basic method)

 

Step 1: Write your HTML code in Notepad.

 

HTML code written in Notepad
HTML code in Notepad

 

Step 2: After you’re done writing your code save it by navigating from File->Save.

 

Saving a HTML code in Notepad

Step 3: Save the file name with .html extension instead of .txt extension to your desired location. Like in this example I’ve saved this file with the name Sample.html.

 

Changing file name and extension to create a HTML document


Step 4: Finally, go to the location where you’ve saved your HTML file.

 

Opening a HTML document


Step 5: Right-click the file then choose open with option. From open with menu choose any web browser of your choice to open your file.

Opening a HTML document using web browser


In this example, I am choosing Microsoft edge you can choose any web browser you have on your PC.

 

Preview of given HTML code in Microsoft Edge browser

Take away from this

There are plenty of tools to write HTML code you can use any of them. In this blog, I have given a basic idea of how HTML code is written in Notepad with a simple example.

HTML is the skeleton of any webpage and if you want to be a web developer you need a strong grip of HTML. To start learning web development the three basic things you need to know are HTML, CSS, and Javascript. Check out the link below to know more about HTML, CSS, and Javascript.


 https://www.w3schools.com/html/html_intro.asp


W3schools.com has everything you need to learn about HTML.


Download links:

VS Studio code 

Sublime text

Atom text editor


Hope this blog helped you.

Thank you for reading 😇


Comments