Hello World A Step-by-Step Guide to Building Your First HTML Page

You are currently viewing Hello World A Step-by-Step Guide to Building Your First HTML Page

Open a simple text editor on your computer. You can use Notepad on Windows, TextEdit on macOS, or any code editor of your choice (like Visual Studio Code, Sublime Text, Atom, etc.).

Type the following HTML code into your text editor:

<!DOCTYPE html>
<html>
<head>
    <title>Hello World</title>
</head>
<body>
    <h1>Hello, World!</h1>
</body>
</html>

This is a basic HTML structure. It includes an opening and closing html tag, head and body sections, and an h1 (heading 1) element that contains the “Hello, World!” text.

Save your file with an “.html” extension. For example, you can name it “index.html”.

Find the location where you saved your index.html file on your computer.

Right-click on your HTML file, and open it with a web browser (e.g., Google Chrome, Mozilla Firefox, Microsoft Edge).

Your web browser will render the HTML code, and you should see a page displaying “Hello, World!” as a heading.

Congratulations! You’ve Written and Executed Your First HTML Program!

Quick Tips for Beginners:

  • HTML is not case-sensitive, but it’s a good practice to write tags in lowercase for consistency.
  • The <!DOCTYPE html> declaration defines the document type and should be included at the beginning of your HTML document.
  • The content inside the body tag is what appears on the webpage.

Feel free to experiment with your HTML code. Change the text, add more elements, and see how it affects your webpage. As you progress, you can explore CSS for styling and JavaScript for interactivity.

Leave a Reply