How to write “Hello World” in HTML

How to write “Hello World” in HTML

Writing a simple “Hello World” programme is the first step in becoming familiar with a new language. The text-based approach for defining web-page layouts is HTML (Hypertext Markup Language).

HTML Boilerplate Code

A simple boilerplate HTML code is supplied in the code below, and a single <h1> tag is used to write “Hello World” on the web page.

Any text editor can be used to create HTML files. To be identified as HTML files, the files must be stored with the .html or .htm extension.

<!DOCTYPE html>
<html lang="en">
        <meta charset="UTF-8">
		  <meta name="viewport"
	     content="width=device-width, initial-scale=1">
        <h1>Hello World!</h1>


Once created, this file can be opened in any web browser. This is what will be displayed in your browser.

Browser preview of Hello World! HTML page.

Yes, printing anything from a Web page is that simple. To run HTML code in a Web page, you don’t need to compile it. Because HTML is a markup language, you can simply edit your code and hit the refresh button to see the changes immediately on your Web page.

Share this article. Follow me on Twitter for more updates.

Pin It on Pinterest