How to Build a Website using HTML?
Last Updated :
11 Oct, 2024
Building a website using HTML (Hypertext Markup Language) is the foundation of web development. HTML allows you to structure content, define headings, paragraphs, lists, and links, and create visually appealing web pages.
In this article, we'll learn the fundamentals of How to build a Website using HTML with all the key components like elements, tags, file structure, etc.
Set Up Your HTML document
To create a basic HTML website, the first step is to set up an HTML document. This can be done using any text editor, such as Notepad, Sublime Text, or Visual Studio Code. Here's how to get started:
To create an HTML document follow the following steps:
Step 1: Open your text editor such as Notepad Sublime Text, etc.
Step 2: Write the code given below in the text editor.
HTML
<!DOCTYPE html>
<html>
<head>
<title>First HTML file</title>
</head>
<body>
<p>Hello Everyone!!</p>
</body>
</html>
Step 3: Save this file with the .html/.htm extension.

Step 4: Open that file with any browser. The output will be displayed.

So this is how we create a simple HTML document.
Building HTML Website
To create a website using HTML, you need to understand the various tags and attributes. HTML tags are used to structure the content, while attributes provide additional information.
Essential HTML Tags:
- Header Tags (
<h1>
to <h5>
):- Use these tags to create headings of different sizes.
<h1>
is the largest heading, while <h5>
is the smallest.
- Bold Tags (
<strong>
or <b>
):- Make text appear bold using these tags.
- Italic Tags (
<i>
or <em>
):- Use
<i>
for italics. <em>
provides semantic emphasis on important text.
- Ordered List (
<ol>
):- Define an ordered list (numerical or alphabetical).
- Each list item starts with
<li>
.
Type | Description |
---|
type="1" | Numbered with numbers(default) |
type="A" | Numbered with Uppercase Alphabets |
type="a" | Numbered with Lowercase Alphabets |
type="I" | Numbered with Uppercase Roman Numbers |
type="i" | Numbered with Lowercase Roman Numbers |
5. Unordered List (<ul>
):
- Display elements in bullet form.
- Use
<li>
for each list item.
Type | Description |
---|
type="disc" | Items are marked in Bulletin. (default) |
type="circle" | Items are marked with hollow circles. |
type="square" | Items are marked with squares. |
type="none" | Items are not marked. |
6. Image Tag: If we need to add an image to our website we need to use the following syntax.
Syntax:
<img src="filename" alt="name / bit about image">
Here,
- img: Tells browser that we want to add an image.
- src: Tells source of image for eg image from desktop or a website.
- alt: This attribute is used to describe an image. If the image is not able to download in a web browser due to some reason then alt is shown.
7. Anchor Tag: This tag is mainly used to connect one website to another.
Syntax:
<a href="https://www.geeksforgeeks.org/c-plus-plus/"> Click Here to Learn C++</a>
Note: Nesting is possible in HTML, which means that we can write one tag between another tag.
Example: In this example we providing steps to make spread cookies, including preheating, mixing ingredients, shaping dough, baking, and serving. Ordered list structured with steps. Page title "Steps To Form Spread Cookies."
HTML
<!DOCTYPE html>
<html>
<head>
<title> Steps To Form Spread Cookies </title>
</head>
<body>
<h1> Spread Cookies</h1>
<br>
<h2> Steps:- </h2>
<ol type="I">
<li>Preheat kitchen appliance to 350ºF (180ºC).</li>
<li> In a massive bowl, combine along the spread, sugar, and egg. </li>
<li>Scoop out a spoon of dough and roll it into a ball.
Place the cookie balls onto a slippy baking sheet.
</li>
<li>For further decoration and to form them cook additional
equally, flatten the cookie balls by pressing a fork down
on prime of them, then press it down once more at a 90º
angle to form a criss-cross pattern.
</li>
<li>Bake for 8-10 minutes or till rock bottom of
the cookies square measure golden brown.
</li>
<li>Remove from baking sheet and freeze it.</li>
<li><b>ENJOY!!</b></li>
</ol>
</body>
</html>
Output

Example: Building a Basic HTML Website
Let's create a simple webpage for a "Steps to Bake Cookies" guide, using an ordered list to outline the steps.
HTML
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>GeeksForGeeks</title>
</head>
<body style="background-color:#D5F5E3 ">
<img src=
"https://upload.wikimedia.org/wikipedia/commons/4/43/GeeksforGeeks.svg"
style="display: block; margin-left:
auto;margin-right: auto;
width: 10%;">
<h1 style="color:green;text-align:center">
<strong>GeeksForGeeks</strong>
</h1>
<h1><strong>Table of Content</strong></h1>
<h2><strong>C++</strong></h2>
<div>C++ is an object-oriented programming language
that is widely used for competitive programming,
Data structure, and Algorithms, developing
operating Systems, etc.
</div>
<h3><em>Some of its topic are given below:- </em></h3>
<ul>
<li>
<a href=
"https://www.geeksforgeeks.org/c-plus-plus/#Basics">
Basics
</a>
</li>
<li><a href=
"https://www.geeksforgeeks.org/difference-c-structures-c-structures/">
Difference Between C Structures and C++ Structures</a></li>
<li><a href=
"https://www.geeksforgeeks.org/comparison-of-inheritance-in-c-and-java/">
Comparison of Inheritance in C++ and Java</a></li>
<li><a href=
"https://www.geeksforgeeks.org/static-keyword-in-java/">
Comparison of static keyword in C++ and Java</a></li>
<li><a href=
"https://www.geeksforgeeks.org/comparison-of-exception-handling-in-c-and-java/">
Comparison of Exception Handling in C++ and Java</a></li>
<li><a href=
"https://www.geeksforgeeks.org/basic-input-output-c/">
Basic Input / Output in C++</a></li>
<li><a href=
"https://www.geeksforgeeks.org/write-a-c-program-that-wont-compile-in-cpp/">
Write a C program that won’t compile in C++</a></li>
<li><a href=
"https://www.geeksforgeeks.org/references-in-c/">
References in C++</a></li>
</ul>
<h2 style="color:red;"><em>Java</em></h2>
<div>Java has been one amongst the foremost standard
programming languages for several years. When
compared with C++, Java codes are typically
additional reparable as a result of Java
doesn't enable several things which can
cause bad/inefficient programming if used
incorrectly.For instance, non-primitives are
references in Java.
</div>
<h3><em>Some of its Topics are given below:- </em></h3>
<ul>
<li><a href=
"https://www.geeksforgeeks.org/introduction-to-java/">
Introduction to Java</a></li>
<li><a href=
"https://www.geeksforgeeks.org/c-vs-java-vs-python/">
C++ vs Java vs Python</a></li>
<li>
<a href=
"https://www.geeksforgeeks.org/jvm-works-jvm-architecture/">
How JVM Works – JVM Architecture?</a>
</li>
<li><a href=
"https://www.geeksforgeeks.org/java-basic-syntax/">
Java Basic Syntax</a></li>
<li><a href=
"https://www.geeksforgeeks.org/java-identifiers/">
Java Identifiers</a></li>
<li><a href=
"https://www.geeksforgeeks.org/variable-scope-in-java/">
Scope of Variables In Java</a></li>
<li><a href=
"https://www.geeksforgeeks.org/decision-making-javaif-else-switch-break-continue-jump/">
Decision Making in Java (if, if-else, switch, break, continue, jump)
</a></li>
<li><a href=
"https://www.geeksforgeeks.org/java-arithmetic-operators-with-examples/">
Java Arithmetic Operators with Examples</a></li>
</ul>
<h2 style="color: blue;">
Python</h2>
<div> Python language is being employed in website
development, Machine Learning applications,
at the side of all innovative technology in
Software World. Python language is extremely
compatible for Beginners, additionally for
knowledgeable programmers with alternative
programming languages like C++ and Java.
</div>
<h3><em>Some of its topics given below are:- </em></h3>
<ul>
<li><a href=
"https://www.geeksforgeeks.org/python-language-introduction/">
Python Language Intro</a></li>
<li><a href=
"https://www.geeksforgeeks.org/structuring-python-programs/">
Structures</a></li>
<li><a href=
"https://www.geeksforgeeks.org/python-keywords/">
Keywords</a></li>
<li><a href=
"https://www.geeksforgeeks.org/python-if-else/">
Decision Making</a></li>
<li><a href=
"https://www.geeksforgeeks.org/python-3-basics/">
Python 3 basics</a></li>
</ul>
<h1 style="text-align: center">Thank You</h1>
</body>
</html>
Output:
build a Website using HTML Example Output
Similar Reads
Non-linear Components In electrical circuits, Non-linear Components are electronic devices that need an external power source to operate actively. Non-Linear Components are those that are changed with respect to the voltage and current. Elements that do not follow ohm's law are called Non-linear Components. Non-linear Co
11 min read
Spring Boot Tutorial Spring Boot is a Java framework that makes it easier to create and run Java applications. It simplifies the configuration and setup process, allowing developers to focus more on writing code for their applications. This Spring Boot Tutorial is a comprehensive guide that covers both basic and advance
10 min read
HTML Tutorial HTML stands for HyperText Markup Language. It is the standard language used to create and structure content on the web. It tells the web browser how to display text, links, images, and other forms of multimedia on a webpage. HTML sets up the basic structure of a website, and then CSS and JavaScript
11 min read
Class Diagram | Unified Modeling Language (UML) A UML class diagram is a visual tool that represents the structure of a system by showing its classes, attributes, methods, and the relationships between them. It helps everyone involved in a projectâlike developers and designersâunderstand how the system is organized and how its components interact
12 min read
Backpropagation in Neural Network Back Propagation is also known as "Backward Propagation of Errors" is a method used to train neural network . Its goal is to reduce the difference between the modelâs predicted output and the actual output by adjusting the weights and biases in the network.It works iteratively to adjust weights and
9 min read
3-Phase Inverter An inverter is a fundamental electrical device designed primarily for the conversion of direct current into alternating current . This versatile device , also known as a variable frequency drive , plays a vital role in a wide range of applications , including variable frequency drives and high power
13 min read
Polymorphism in Java Polymorphism in Java is one of the core concepts in object-oriented programming (OOP) that allows objects to behave differently based on their specific class type. The word polymorphism means having many forms, and it comes from the Greek words poly (many) and morph (forms), this means one entity ca
7 min read
CTE in SQL In SQL, a Common Table Expression (CTE) is an essential tool for simplifying complex queries and making them more readable. By defining temporary result sets that can be referenced multiple times, a CTE in SQL allows developers to break down complicated logic into manageable parts. CTEs help with hi
6 min read
What is Vacuum Circuit Breaker? A vacuum circuit breaker is a type of breaker that utilizes a vacuum as the medium to extinguish electrical arcs. Within this circuit breaker, there is a vacuum interrupter that houses the stationary and mobile contacts in a permanently sealed enclosure. When the contacts are separated in a high vac
13 min read
Python Variables In Python, variables are used to store data that can be referenced and manipulated during program execution. A variable is essentially a name that is assigned to a value. Unlike many other programming languages, Python variables do not require explicit declaration of type. The type of the variable i
6 min read