Getting Started with HTML Coding
Last Updated :
23 Jul, 2025
HTML (Hypertext Markup Language) is the standard language for creating web pages and applications. It uses tags to structure content, such as text, images, and links, enabling browsers to interpret and display information accurately, forming the backbone of the World Wide Web. It was developed in the early 1990s by the British Computer Scientist Tim Berners-Lee who was also credited for the development of the World Wide Web(WWW).
The W3C (The current developer of HTML since the early 2000s) released HTML5, the latest version of HTML in the year 2014. HTML5 includes many new features and enhancements, such as improved multimedia support, new semantic elements for better document structure, and better support for mobile devices. HTML5 is now widely used for creating web pages and applications and is supported by all major web browsers and local editors.
Getting Started with HTML Coding
Getting started with HTML coding is not as difficult as it may seem. HTML is just a simple markup language, learning it just needs some reading and consistent practice. So before you start coding, it is recommended to learn the basic HTML syntax, tags, elements, semantics, links, and images.
Role of HTML in Web Development
HTML (Hypertext Markup Language) serves as the foundation of web development. It structures content using tags to create elements such as headings, paragraphs, images, and links. HTML provides the skeleton of a webpage, forming the structure that CSS styles and JavaScript enhances. It facilitates accessibility, SEO optimization, and compatibility across browsers, making it essential for building functional and visually appealing websites and applications.
How Do I Write HTML Code?
Writing HTML involves understanding HTML tags, which are enclosed within angle brackets. Each tag consists of an opening and closing part, serving as building blocks that define the structure of a webpage. These tags function as the bricks and mortar of web development, and comprehending their roles is fundamental for effective webpage creation.
HTML Code Example:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>HTML structure Page</title>
</head>
<body>
<h1>Hello, GeeksforGeeks!</h1>
<p>A computer science portal.</p>
</body>
</html>
Explanation:
- In the above example we Declares the HTML version being used.
- Defines the basic structure of the webpage.
- Contains metadata such as character encoding and title.
- Contains visible content like headings and paragraphs displayed in the browser.
How to Create a Website Using HTML?
To create a website using HTML, start by designing its structure with tags like <html>, <head>, and <body>, and adding content using appropriate tags for text, images, and links. Save files with a .html extension and open them in a browser for local testing. To publish online, obtain web hosting services, and a domain name for accessibility. Additionally, enhance the website's appearance and functionality further using CSS and JavaScript.
How to Start HTML Code?
Here are some important step to follow
- Text Editor Selection: Choose a suitable text editor like Notepad, Sublime Text, or Visual Studio Code to write and edit HTML code comfortably, offering features like syntax highlighting and auto-completion for efficient coding.
- HTML5 Declaration: Begin your HTML document with <!DOCTYPE html> to signify its HTML5 standard, ensuring compatibility and proper rendering across modern web browsers.
- Building the Structure: Utilize essential HTML tags such as <html>, <head>, and <body> to create the fundamental structure of your webpage, delineating its content and metadata.
- Adding Metadata: Enhance accessibility and search engine optimization by incorporating metadata like the <title> tag for page titles and <meta> tags for specifying character encoding, viewport settings, and other relevant information.
- Save Your HTML File: Ensure to save your HTML file with a .html extension to designate it as a web page, facilitating easy identification and opening in web browsers.
- Double-Click to Open: Simply double-click the saved HTML file to open it in your default web browser, allowing you to instantly preview the webpage and assess its appearance and functionality.
- Alternative Browsers: Test your HTML code across different web browsers such as Chrome, Firefox, or Edge to ensure consistent rendering and functionality, considering the varying interpretations and implementations of web standards.
- Inspect and Debug: Utilize built-in browser developer tools to inspect and debug your HTML code, enabling you to identify and rectify any errors or issues affecting the webpage's performance or appearance.
Example:
<!DOCTYPE html>
<html>
<head>
<title>Hello HTML</title>
</head>
<body>
<p>Hello</p>
</body>
</html>
Explanation:
- Here we Specifies HTML5 as the document type.
- Contains metadata, such as the title of the webpage.
- Holds the content visible in the browser.
- Displays a paragraph with the text "Hello".
How to Create an HTML File with an Example?
- Choose a Text Editor: Select a text editor like Notepad, Sublime Text, or Visual Studio Code for writing HTML code, offering features like syntax highlighting and auto-completion to enhance coding efficiency.
- Structure Your HTML: Begin with <!DOCTYPE html> and define the document structure using tags like <html>, <head>, and <body>.
- Add Content: Insert content using appropriate HTML tags such as <h1>, <p>, <img>, and <a> to represent headings, paragraphs, images, and links respectively.
- Save with .html Extension: Save your file with a .html extension, ensuring it's recognized as an HTML document.
- Preview Locally: Open the HTML file in a web browser to preview how it renders and ensure everything appears as intended.
- Introducing CSS for Styling: Enhance the appearance of your HTML content by introducing CSS (Cascading Style Sheets) for styling elements, adding colors, fonts, layout adjustments, and more to create visually appealing web pages.
In this, you will learn the basic tags of HTML which are commonly used in HTML coding.
Check this article for HTML Tags - A to Z List
Tags are the type of keywords that tells the web browser how to display or format the content written inside those tags. Tags have basically three parts opening tag, content, and closing tag.
HTML Tags Syntax:
<tag> Content... </tag>
Note: There are few HTML tags that are not closed like <br> tag, <hr> tag, etc.
HTML Links Tag
HTML links are hyperlinks that allow users to go from one web page to another web page by just clicking on that link.
Links Tag Syntax:
<a href="URL"> Link Text</a>
HTML Link: www.geeksforgeeks.org/html-links/
HTML Images Tag
HTML images are used to embed the images in your web pages to make them attractive and more resourceful.
Images Tag Syntax:
<img src="URL" alt="alternative Image Text">
HTML Semantics Tag
Semantic elements are the elements that clearly classify the meaning of that element to the web browser and developer
HTML Semantic Elements:
<article>, <form>, <table>, <header>, <footer>, <time>, etc. all these elements clearly describe the meanings.
HTML Non-Semantic Elements
HTML non-semantic elements are tags that convey no inherent meaning or structure to web content. They're used for styling and layout purposes only, without indicating the significance of their enclosed content. Examples include <div> and <span>.
Now, since you can now write the HTML code you must need an HTML editor so, let's begin by setting up your HTML editor.
Setting the HTML editor
HTML text editors are used to create and modify web pages created using HTML. There are many online and offline/local text editors available that you can use.
Using Online Text Editor
There are many online HTML text editors on which you can write HTML code and instantly see how your web page will look so it makes it very easy to edit the text also there is no need for setting up a local editors
HTML
<!-- DOCTYPE defines the information to the
browser about the type of document -->
<!DOCTYPE html>
<!-- <html> tag tells the browser that
it is an HTML code -->
<html>
<!-- head tag is a container which
stores metadata -->
<head>
<!-- title tag is used to give a title
to your document -->
<title>Example</title>
</head>
<!-- body tag contains all the content
of your HTML document -->
<body>
<!-- Heading declaration of type 2 -->
<h2>Welcome To GFG</h2>
<!-- paragraph of the document -->
<p>The Computer Science Portal for Geeks</p>
</body>
</html>
Output:
The output of the above codeUsing Local Text Editors
There are many local/offline text editors available for getting started with coding you need to have one of them. Some text editors are mentioned below:
- Visual Studio Code
- Notepad
- Notepad++
- Sublime text
Now, Since you must have chosen your text editor, let's begin by writing a simple HTML code.
HTML
<!DOCTYPE html>
<html>
<head>
<title>My Web Page</title>
</head>
<body>
<h1>My First HTML Document</h1>
<h2>Defination of HTML</h2>
<p>
HTML stands for Hyper Text Markup
Language it is a standard markup
Language for the documents designed
to be displayed in the web browser.
The supported web browsers are
Chrome, Edge, Safari, Opera and
Firefox. For styling the HTML
document we use CSS(Cascading
Style Sheet)
</p>
</body>
</html>
Output:
The output of the above codeConclusion
getting started with HTML coding is straightforward. Begin by understanding basic concepts like document structure and tags. Choose a suitable text editor and start writing HTML code to create the structure and content of your webpage. Utilize tags for headings, paragraphs, images, and links. Remember to save your file with a .html extension and preview it in a browser for testing. With practice, HTML coding becomes intuitive and rewarding.
Similar Reads
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
Basics
HTML IntroductionHTML stands for Hyper Text Markup Language, which is the core language used to structure content on the web. It organizes text, images, links, and media using tags and elements that browsers can interpret. As of 2025, over 95% of websites rely on HTML alongside CSS and JavaScript, making it a fundam
6 min read
HTML EditorsAn HTML Editor is a software application designed to help users create and modify HTML code. It often includes features like syntax highlighting, tag completion, and error detection, which facilitate the coding process. There are two main types of HTML editors: Text-Based Editors - Allow direct codi
5 min read
HTML BasicsHTML (HyperText Markup Language) is the standard markup language used to create and structure web pages. It defines the layout of a webpage using elements and tags, allowing for the display of text, images, links, and multimedia content. As the foundation of nearly all websites, HTML is used in over
7 min read
HTML Structure & Elements
HTML ElementsAn HTML Element consists of a start tag, content, and an end tag, which together define the element's structure and functionality. Elements are the basic building blocks of a webpage and can represent different types of content, such as text, links, images, or headings.For example, the <p> ele
5 min read
HTML AttributesHTML Attributes are special words used within the opening tag of an HTML element. They provide additional information about HTML elements. HTML attributes are used to configure and adjust the element's behavior, appearance, or functionality in a variety of ways. Each attribute has a name and a value
8 min read
HTML HeadingsHTML headings are used to define the titles and subtitles of sections on a webpage. They help organize the content and create a structure that is easy to navigate.Proper use of headings enhances readability by organizing content into clear sections.Search engines utilize headings to understand page
4 min read
HTML ParagraphsA paragraph in HTML is simply a block of text enclosed within the <p> tag. The <p> tag helps divide content into manageable, readable sections. Itâs the go-to element for wrapping text in a web page that is meant to be displayed as a distinct paragraph.Syntax:<p> Some Content...
5 min read
HTML Text FormattingHTML text formatting refers to the use of specific HTML tags to modify the appearance and structure of text on a webpage. It allows you to style text in different ways, such as making it bold, italic, underlined, highlighted, or struck-through. Table of ContentCategories of HTML Text FormattingLogic
4 min read
HTML Block and Inline ElementsHTML elements are either block-level, which structure the layout and span full width (like <div> or <p>), or inline, which styles content within blocks without breaking the flow (like <span> or <a>). This distinction covers 80â90% of common HTML usage.Inline and Block Level E
3 min read
HTML CharsetsHTML charsets define how characters are represented in a web document. The character encoding ensures that text appears correctly across different devices and platforms.The <meta> tag's charset attribute is used to specify which character encoding the HTML document uses. By setting the charset
4 min read
HTML List
HTML Visuals & Media
HTML ColorsHTML Colors can be applied to text, backgrounds, borders, links, forms, tables, etc. This article provides an in-depth look at how colors can be applied to various elements such as text, backgrounds, borders, links, forms, and tables in HTML. We will explore different color formats including hexadec
11 min read
HTML Links HyperlinksHTML Links, also known as hyperlinks, are defined by the <a> tag in HTML, which stands for "anchor." These links are essential for navigating between web pages and directing users to different sites, documents, or sections within the same page. The basic attributes of the <a> tag include
3 min read
HTML ImagesThe HTML <img> tag is used to embed an image in web pages by linking them. It creates a placeholder for the image, defined by attributes like src, width, height, and alt, and does not require a closing tag.There are two ways to insert the images into a webpage:By providing a full path or addre
7 min read
HTML FaviconA favicon (short for "favorite icon") is a small yet important image that appears next to your websiteâs title in the browser tab. Also known as a tab icon or bookmark icon, it helps users quickly identify and return to your site. Studies show that over 85% of users rely on visual cues like favicons
4 min read
HTML VideoThe <video> element in HTML is used to show video content on web pages. It supports various video formats, including MP4, WebM, and Ogg. It is introduced in HTML5.Scroll down to the End, there is a Tutorial Video which is a live example of the Video Element displaying on this webpage.Syntax:
4 min read
HTML Layout & Design
HTML TablesHTML (HyperText Markup Language) is the standard markup language used to create and structure web pages. It defines the layout of a webpage using elements and tags, allowing for the display of text, images, links, and multimedia content. As the foundation of nearly all websites, HTML is used in over
10 min read
HTML IframesAn iframe, or Inline Frame, is an HTML element represented by the <iframe> tag. It functions as a 'window' on your webpage through which visitors can view and interact with another webpage from a different source.Iframes are used for various purposes like:Embedding Multimedia: Easily integrate
4 min read
HTML LayoutHTML layouts are a technique used to divide a web page into multiple sections, making it easier to apply styles, organize content, and manage operations efficiently. This division improves readability, accessibility, and overall user experience.HTML layout is achieved through elements like <heade
4 min read
HTML File PathsHTML file paths specify the location of files or resources that a webpage needs to access, such as images, videos, scripts, or other HTML documents. These paths tell the web browser where to find the files required to display the content correctly or to execute scripts as intended. To insert a file
3 min read
HTML Projects& Advanced Topics
HTML FormsHTML forms, defined using the <form> Tags are essential for collecting user input on web pages. They incorporate a variety of interactive controls such as text fields, numeric inputs, email fields, password fields, checkboxes, radio buttons, and submit buttons. Over 85% of websites rely on for
5 min read
HTML5 SemanticsHTML5 introduced a range of semantic elements that clearly describe their purpose in human and machine-readable language. Unlike non-semantic elements, which provide no information about their content, semantic elements clearly define their content. For instance, <form>, <table>, and
6 min read
HTML URL EncodingA Uniform Resource Locator (URL) is simply the address of a website to access the website content. Web browsers retrieve pages from web servers using a URL (Uniform Resource Locator).What is URL Encoding?URL Encoding is the process of converting the URL into a valid format that is accepted by web br
4 min read
HTML Responsive Web DesignHTML Responsive Web Design is a modern approach to web development that ensures web pages look great on any device, from phones and tablets to desktop computers. It focuses on making HTML elements automatically adjustâresizing, hiding, or repositioning based on the screen size. This approach guarant
11 min read
Top 10 Projects For Beginners To Practice HTML and CSS SkillsLearning to code is an exciting journey, especially when stepping into the world of programming with HTML and CSSâthe foundation of every website you see today. For most beginners, these two building blocks are the perfect starting point to explore the creative side of web development, designing vis
8 min read
HTML Tutorial References
HTML Tags - A to Z ListHTML Tags are fundamental elements used to structure and format content on web pages. They provide instructions to web browsers on how to render text, images, links, and other media.HTML tags are enclosed in angle brackets < > and usually come in pairs: an opening tag and a closing tag. The cl
15+ min read
HTML Attributes Complete ReferenceHTML attributes are special words placed inside the opening tag of an HTML element to define its characteristics. Each attribute has two parts:Attribute nameAttribute value (separated by an equal sign = and enclosed in double quotes " ").Syntax:<tag_name attribute_name="value"> Contents...
8 min read
HTML Global AttributesHTML attributes provide additional information about an element and define its properties. Global attributes are special types of attributes that can be used with any HTML element, offering common functionality to enhance behavior and presentation.Global attributes can be applied to any HTML element
5 min read
HTML5 Complete ReferenceHTML (HyperText Markup Language) is the standard language used to create and design web pages. It defines the structure and layout of a webpage using a series of elements and tags.HTML5 is the latest version of HTML, bringing significant improvements for building modern web applications.It introduce
8 min read
HTML5 MathML Complete ReferenceThe MathML comes in HTML5. The current MathML version is 3. It was introduced in the year 2015. MathML stands for Mathematics Markup Language. It is used to represent mathematical equations or expressions in web browsers, like other HTML elements. MathML is used to describe mathematics as a basis fo
3 min read
HTML DOM Complete ReferenceHTML DOM (Document Object Model) is a programming interface that represents the elements of an HTML document in a tree-like structure.Allows developers to change content and layout using JavaScript.Enables dynamic updates and user interaction on websites.Facilitates the addition, removal, or modific
15+ min read
HTML DOM Audio/Video Complete ReferenceHTML DOM Audio/Video properties and methods allow developers to control audio and video elements programmatically.These controls include playing, pausing, stopping, and adjusting volume.DOM methods enable dynamic interaction and customization of media elements.They enhance the user experience by off
2 min read
SVG Element Complete ReferenceSVG stands for Scalable Vector Graphic. It can be used to make graphics and animations like in HTML canvas. It is a type of vector graphic that may be scaled up or down. Elements are the core things that is required to work with SVGs.List of SVG Elements:SVG ElementsDescription<a>The <a>
5 min read
SVG Attribute Complete ReferenceSVG stands for Scalable Vector Graphic. It can be used to make graphics and animations like in HTML canvas. It is a type of vector graphic that may be scaled up or down. Attributes are the things that give the SVG shape, color, etc it will make the SVGs as attractive as you need.List of SVG Attribut
8 min read
SVG Property Complete ReferenceSVG stands for Scalable Vector Graphic. It can be used to make graphics and animations like in HTML canvas. It is a type of vector graphic that may be scaled up or down. Properties are used for passing the value to the element, there are lots of properties that can be used in SVG elements. table{ di
7 min read
HTML Canvas Complete ReferenceThe HTML âcanvasâ element is used to draw graphics via JavaScript. The âcanvasâ element is only a container for graphics. One must use JavaScript to actually draw the graphics. Canvas has several methods for drawing paths, boxes, circles, text, and adding images.Example: This example shows the basic
4 min read