Write an HTML program to display hello world.
Description: Write an HTML program that displays “Hello, World!” on a web page.
Hint:
- Use the basic page structure: doctype, html, head and body.
- Put the text inside the body, in a heading or paragraph tag.
HTML program to display Hello World
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Hello World</title>
</head>
<body>
<h1>Hello, World!</h1>
</body>
</html>
Output in the browser:
Output in the browser
Hello, World!
How it works
<!DOCTYPE html>tells the browser that this is an HTML5 page.- The
<title>is shown on the browser tab. - The
<h1>inside the body is the visible heading.
Learn the structure in HTML Page Structure.
Learn more about the similar topics:
| Tutorials |
|---|
| HTML Introduction |
| HTML First Program using Notepad |
| HTML Page Structure |
| Exercises & Assignments |
|---|
| Steps to Create a Webpage in HTML using Notepad |
| Write an HTML program to display hello world. |
| Write an HTML program to create a page about yourself |