Basic Html Code To Print Hello World

3 min read Jul 03, 2024
Basic Html Code To Print Hello World

Basic HTML Code to Print "Hello World"

This is a simple guide to print the classic "Hello World" message using basic HTML code. This will be your first step into the world of web development.

The Code

Here's the HTML code you need:




  Hello World


  

Hello World!

Explanation

Let's break down each part of the code:

  • <!DOCTYPE html>: This declaration tells the browser that this is an HTML5 document.
  • <html>: This is the root element of the HTML document. It contains all the other elements.
  • <head>: This section contains metadata about the HTML document, such as the title and links to external resources.
  • <title>: This element defines the title of the document that appears in the browser tab or window title bar.
  • <body>: This section contains the visible content of the HTML document, such as text, images, and other elements.
  • <h1>: This is a heading tag, used to display large, important text. Here, it displays the "Hello World" message.

Running the Code

  1. Save the code: Save the code in a text editor as a file named "hello.html".
  2. Open the file in a browser: Double-click the "hello.html" file to open it in your web browser.

You should now see the "Hello World!" message displayed on your browser.

Conclusion

This is the most basic way to display "Hello World" using HTML. Congratulations on taking your first step into web development!

You can further customize the code by adding more text, images, and other elements to make your webpage more interesting.

Latest Posts


Featured Posts