Create Html Page

You can create your first HTML page by the following steps:

Step 1: Open the Text Editor

In this step, we have to open any text editor such as Notepad or Notepad++ for writing an HTML code. The following image is the screenshot of the text editor (notepad++) for writing the HTML code.

Create Html Page

Step 2: Type the HTML code.

In this step, we have to type the HTML code in the text editor. The HTML code is composed of various tags and always begins with the opening tag of HTML and complete with the closing tag of HTML.

The following block describes the syntax for creating any HTML page:

  1. <HTML>   
  2. <HEAD>  
  3. <!– The Head tag is used to create a title of web page, CSS syntax for a web page, and helps in written a JavaScript code. –>  
  4. </HEAD>  
  5. <BODY>  
  6. <!– The Body tag is used to display the content on a web page, which is specified between the body tag.  –>  
  7. </BODY>  
  8. </HTML> <!– It is the opening tag of any HTML –>  

In the above syntax, some important tags or elements are used, which are given below:

<HTML>: It is the opening tag of any HTML code.

<HEAD>: The Head tag is used to create a title of the web page, CSS syntax for a web page, and helps in written a JavaScript code The <head> must be closed before the opening of <body> tag.

<BODY>: The Body tag is used to display the content or text on a web page, which is specified between the body tag.–>

</HTML>: It is the Closing tag of any HTML code.

Example: The following example creates a simple HTML page as an example through which you can understand easily:

  1. <HTML> <!– It is the opening tag of any HTML –>  
  2. <HEAD>  
  3. <!– The Head tag is used to create a title of web page, CSS syntax for a web page, and helps in written a JavaScript code. –>  
  4. <title> <!– This tag is used to display the title of the Web Page –>  
  5. Simple HTML Page  
  6. </title>  
  7. <script>  
  8. <!– This tag helps in written the JavaScript Code –>  
  9. </script>  
  10. <style>. 2  
  11. /* This tag is used to create a Cascading Style Sheet for displaying the attractive web page. */  
  12. </style>  
  13. </HEAD>  
  14. <BODY>  
  15. <center> <!– This tag align the text as center –>  
  16. JavaTpoint  
  17. <!– The Body tag is used to display the content on a web page which is specify between the body tag.  –>  
  18. </center>  
  19. </BODY>  
  20. </HTML>  
Test it Now

Step 3: Save the HTML code.

After typing the complete HTML code, we have to save that file in a folder with .html extension. We can easily save the html file by clicking on the File menu and then click on Save As option. After that, type the file name with .html extension. The following screenshot describes how we save the above html code in a text editor.

Create Html Page

Step 4: Run the HTML file.

At the last step, we have to execute or run an HTML file from the location where we saved the file. The file will run on a default browser. Consider the below output:

Create Html Page


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *