“Hello, World!” is a simple program that displays the phrase “Hello, World!” on the screen. It is often used as a beginner’s introduction to a programming language, serving as a basic demonstration of the language’s syntax and structure. The program is typically the first thing new programmers learn to write, symbolizing the first step in learning a new programming language.
A simple “Hello, World!” in HTML can be written like this:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hello World</title>
</head>
<body>
<h1>Hello, World!</h1>
</body>
</html>
Explanation:
<!DOCTYPE html>: Declares the document type and version of HTML.<html>: The root element of the HTML document.<head>: Contains metadata, such as the character set and title.<title>: Sets the title of the webpage (displayed in the browser tab).<body>: Contains the content of the webpage.<h1>: A header element that displays “Hello, World!” in a large font.