Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • HTML Tutorial
  • HTML Exercises
  • HTML Tags
  • HTML Attributes
  • Global Attributes
  • Event Attributes
  • HTML Interview Questions
  • HTML DOM
  • DOM Audio/Video
  • HTML 5
  • HTML Examples
  • Color Picker
  • A to Z Guide
  • HTML Formatter
Open In App
Next Article:
HTML Course | Basics of HTML
Next article icon

HTML Course | First Web Page Printing Hello World

Last Updated : 03 Apr, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

So far, we have already learned about the structure of an HTML document, tags, etc in the previous module. Let us use this knowledge to create our first web page.

Here, we are creating a simple webpage that displays a “Hello World” message as the perfect starting point. This exercise will help you understand the foundational structure of HTML and introduce you to headings from <h1> to <h6>.

Why Start with “Hello World”?

“Hello World” is the first step in programming across many languages. By displaying this simple message, you’ll learn how to structure an HTML document and see how headings affect the organization and readability of content on a webpage.

Steps to Create Your First “Hello World” Web Page

Here’s how to build your first webpage in HTML, step-by-step.

Step 1: Open a Text Editor

To create HTML, you need a text editor. You can use:

  • Notepad (Windows)
  • TextEdit (Mac)
  • Or a code editor like VS Code, Sublime Text, or Atom.

Step 2: Write the HTML Code

In your text editor, create a file named index.html and write the following HTML code. This code will display “Hello World”.

HTML
<!DOCTYPE html> <html>  <head>     <title>First Web Page</title> </head>  <body>     Hello World! </body>  </html> 

In this Example:

  • The <!DOCTYPE html> declaration specifies that the document is an HTML5 document.
  • The <html> element encloses the entire HTML content.
  • The <head> section contains metadata, including the <title>, which sets the page’s title as “First Web Page.”
  • The <body> section includes the text “Hello World!”, which will be displayed on the webpage.

Heading Tags: There are six levels of headings defined by HTML. These six heading elements are h1, h2, h3, h4, h5, and h6; with h1 being the highest level and h6 the least.

Let us use these six different Heading tags separately to print “Hello World!” and see the difference. Modify your code in index.html with the below code: 

Code: index.html

HTML
<html> <body>     <h1>Hello World!</h1>     <h2>Hello World!</h2>     <h3>Hello World!</h3>     <h4>Hello World!</h4>     <h5>Hello World!</h5>     <h6>Hello World!</h6> </body> </html> 
  • The code displays “Hello World!” in six different sizes using heading tags <h1> to <h6>.
  • <h1> is the largest and most emphasized heading, while <h6> is the smallest and least emphasized.

To learn more about Heading Tags, Please refer: HTML | Heading.


Next Article
HTML Course | Basics of HTML
author
harsh.agarwal0
Improve
Article Tags :
  • HTML
  • Web Technologies

Similar Reads

  • Introduction to HTML and CSS | Learn to Design Your First Website in Just 1 Week
    Ready to Design Your First Website in Just 1 Week? With this guide, learn how to build a simple yet stylish website in just one week to gain skills and confidence. This is an introduction course to HTML and CSS which will help you learn all about the basics of HTML and CSS needed to begin with Web D
    4 min read
  • HTML Course | Structure of an HTML Document
    HTML (Hypertext Markup Language) is the standard language used to create webpages. It forms the backbone of web development, providing the structure and content for websites. If you're new to web development, understanding HTML is the first step in creating web pages. What is an HTML Document?HTML i
    4 min read
  • HTML Course | First Web Page Printing Hello World
    So far, we have already learned about the structure of an HTML document, tags, etc in the previous module. Let us use this knowledge to create our first web page. Here, we are creating a simple webpage that displays a "Hello World" message as the perfect starting point. This exercise will help you u
    2 min read
  • HTML Course | Basics of HTML
    Now that you've created your first "Hello World" webpage, it's time to learn some important concepts of HTML. In this chapter, we’ll cover basic elements that add content and structure, including paragraphs, images, lists, attributes, comments, and more. Table of Content HTML Paragraph HTML Horizont
    6 min read
  • HTML Course | Starting the Project - Creating Directories
    Now we have understood the important concepts of HTML, it's time to start building a structured web project. In this chapter, you’ll learn how to set up directories and organize files efficiently. It is important to have a well-structured directory for both small and large projects, as it makes your
    3 min read
  • HTML Course | Understanding and Building Project Structure
    Now that you've already set up a basic directory structure, it's time to understand and build the basic structure of our project. Course Navigation We have already created all of the directories needed for our project. Let's just start writing our HTML code. Since we are designing a single-page webs
    3 min read
  • CSS Introduction
    CSS (Cascading Style Sheets) is a language designed to simplify the process of making web pages presentable. It allows you to apply styles to HTML documents by prescribing colors, fonts, spacing, and positioning.The main advantages are the separation of content (in HTML) and styling (in CSS) and the
    5 min read
  • HTML Course | Creating Navigation Menu
    A navigation menu is the first element we see in any website. It allows users to explore different pages and sections easily. In this chapter, you’ll learn how to create a navigation menu in HTML. Course Navigation In the last chapter, we have created the entire structure of our website using HTML e
    6 min read
  • HTML Course | Building Header of the Website
    The header is the top part of the website and the important area for branding and navigation. In this chapter, you’ll learn how to build a header with the tags which we have already learnt. Course Navigation So far, we have created the navigation bar for the header of our website. The next thing to
    4 min read
  • HTML Course | Building Main Content - Section 1
    The main content of a website is where you show the core information that visitors are looking for. This could be text, images, links, or any important details about your services, products, or ideas. Course Navigation We just completed building the header for our website. Let's start building the m
    4 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences