programminghead Logo

How to create HTML file and Write HTML Syntax :

Creating a HTML File :

To create a HTML file we have to use a Text Editor which can Edit and text files. So if you are using Windows OS then you find a Text Editor called NotePad pre installed in your OS. If your are using other OS like MAC/Linux then you can search TextEdit in MAC OS and GEdit in Linux.

Creating HTML file using TextEditor

To create a HTML file we have to open any Text Editor (notepad,GEdit,EditText,Notepad++,Sublime ETC) and inside that Text Editor we have to write HTML Code.
So HTML uses some Tags to create Elements in the Output. So to begin with HTML Codding we have to learn about HTML Syntax.

HTML Syntax :

Syntax simply is a set of rules, principles, and process to write any Language's Code. In HTML Syntax we will learn about HTML tags. like how to write HTML Tags and when and where which tag starts and Closes.

HTML Syntax

   my Text inside HTML Doc

Saving HTML Document :

Saving document is the most impotent step for creating a HTML file. Because we don't save HTML file as simple text. We have to write .html extension after the document name except .txt or other plain text extensions.

Step 1

To save a HTML Document we have to find FILE option at the top left corner of your TextEditor.
After finding FILE option we have to click on in.

Step 2

Now in the File menu you will see many Options like New,Open,Save,Save As ETC. Here we have to click on SAVE to save our HTML Document.

Step 3

After Clicking on SAVE option from the FILE menu you will see a Pop-Up window asking you about your file path name and extension.
(if there isn't any window asking you about File name or Path then do Click on Save As Option from the FILE Menu )
Here select your Location where you want to save your HTML File (Like :Desktop). And gave a name to your HTML file (Like : myfile) followed with .html extension (like: myfile.html).
And click save to save your File.

Step 4

After successfully saving your HTML file with .html you have to Locate your HTML file in the Location where you saved your File. (Like : in Desktop)
Select your File and Double click on it. It will open in your Computer's Defaut Web-Browser. If your file isn't Loading/Opening in Web-Browser then select your HTML file right Click on it and Select Open with option from the menu and select your Browser from there (like : firefox/Chrome/Edge/Opera ETC).


Write to Us