The Wayback Machine - https://web.archive.org/web/20240828103231/https://www.geeksforgeeks.org/html-tutorial/
Open In App

HTML Tutorial

Last Updated : 07 Aug, 2024
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

HTML is the language of the web, used by billions of websites to create the pages you see every day. Want to learn HTML from scratch and make your web pages? This tutorial is for you!

In this HTML tutorial, you will learn how to use HTML to create and style web pages. You will start with HTML fundamentals, such as basic HTML tags and their attributes, classes, layout, and responsiveness. Then, you will move on to advanced HTML5 topics, such as HTML forms, media, APIs, and more. By the end of this tutorial, you will have a solid foundation in HTML.

HTML-Tutorial-copy

What is HTML?

HTML stands for HyperText Markup Language. It is the standard language used to create and design web pages on the internet. It was introduced by Tim Berners-Lee in 1991 at CERN as a simple markup language. Since then, it has evolved through versions from HTML 2.0 to HTML5 (the latest 2024 version).

HTML is a combination of Hypertext and Markup language. Hypertext defines the link between the web pages and Markup language defines the text document within the tag.

Recent Articles on HTML

Hello World Program in HTML

To show you how fun and easy HTML is, We have shown you a classic HTML Hello World program.

HTML
<!DOCTYPE html> 
<html> 

<head> 
    <title>HTML Tutorial</title> 
</head> 

<body> 
    <h2>Welcome To GFG</h2> 
    <p>Hello World! I Don't Give a Bug </p> 
</body> 

</html>

Why to Learn HTML?

Here are some of the key advantages of learning HTML:

  • Web Structure Foundation: HTML provides the fundamental skeleton of every web page. It tells browsers how to display text, images, links, videos, and other elements.
  • Ease of Use: HTML is renowned for its beginner-friendliness. Its straightforward tags and syntax make it a great place to start your web development journey.
  • Gateway to Web Development: Mastering HTML is the first step toward learning more complex web technologies like CSS (for styling) and JavaScript (for interactivity).
  • Diverse Applications: It empowers you to build websites, email templates, newsletters, and much more.
  • Creative Expression: Allows you to bring your ideas to life online, fostering a fun outlet for creativity and design.

Here are all the important concepts covered in HTML. After completing this tutorial, you’ll have a basic understanding of HTML and be ready for the next stage of web development, CSS.

HTML Basics

By learning the basics of HTML, you can start creating your own web pages and bring your ideas to life online.

HTML Tags

HTML tags are the building blocks of web pages. By understanding and using HTML tags effectively, you can create well-structured and informative webpages.

HTML Tables

HTML tables provide a structured way to organize information into rows and columns, making it easy for users to understand and navigate.

HTML Lists

HTML lists organize information clearly on your website. They’re perfect for step-by-step instructions, lists of ingredients, or ranking items. This improves readability and helps users to understand your content.

HTML Formatting

HTML offers tags and attributes to style your website’s text, images, and more. This improves visual appeal, helps users navigate your content, and signals important information to users. Let’s explore some of the common HTML formatting tags.

HTML Form

HTML forms let users interact with your website. Use them to collect contact details, run surveys, search your site, and more. Let’s explore more about HTML form:

HTML Advanced Concepts

Beyond the Basics in HTML there are also advance concept exists. So, once you have mastered the fundamental building blocks of HTML, we can explore advanced HTML concepts for dynamic, interactive, and meaningful web pages.

HTML References

HTML references are essential resources that provide comprehensive information and guidance on the building blocks of webpages. They’re perfect for both experienced developers and those just starting out.

HTML Miscellaneous

This HTML tutorial goes beyond the basics! Explore miscellaneous tags and elements to add comments, help search engines, embed multimedia, design forms, use hex color codes, and define specialized content areas.

HTML Online Quiz

Now, To get the mastery in HTML test your knowledge and sharpen your problem-solving skills with HTML quizzes. The below linked quiz can easily enhance your logical skills and problem solving skills.

HTML Examples

Need HTML inspiration? Explore our collection of HTML examples! Find code for hyperlinks, forms, tables, frames, and much more – all neatly organized for easy learning.

HTML Interview Questions

HTML CheatSheet

HTML Cheat Sheet is a simple, and quick reference list of basic HTML elements and attributes. The purpose of this Cheat Sheet is to provide you with some quick accurate ready-to-use code snippets and necessary HTML tags and attributes.

HTML Tutorial – Prerequisites

This HTML tutorial is perfect for beginners! No prior knowledge is needed, but basic computer skills will help you get started.

Frequent Asked Questions about HTML

Why HTML is important for web development?

HTML, or HyperText Markup Language, is the standard markup language for creating and designing web pages. It structures content on the web, allowing browsers to interpret and display text, images, links, and other elements. Understanding HTML is fundamental for anyone entering web development, as it forms the backbone of every web page.

What are HTML tags and how do they work?

HTML uses tags to define elements on a web page. Tags are enclosed in angle brackets (“< >”), and they come in pairs: an opening tag and a closing tag. The content between these tags specifies the element. For example, <p> is an opening paragraph tag, and </p> is the closing tag. Understanding how tags work is crucial for structuring content and applying styling.

What software do I need to learn HTML?

You only need a simple text editor, like Notepad on Windows or TextEdit on Mac. For Output, you’ll need a web browser, like Chrome, Firefox, or Safari.

Is HTML difficult to learn for beginners?

HTML is considered one of the easiest programming languages to learn, especially for beginners. Its syntax is very basic, and it provides instant visual feedback, making it an ideal starting point for those new to coding.

What is the difference between HTML and HTML5?

HTML5 is the latest version of HTML, introducing new elements, attributes, and APIs that enhance web development capabilities. While HTML5 maintains compatibility with older HTML versions, it brings new features like native support for video and audio, improved form handling, and enhanced semantics. Learning HTML5 is recommended for staying current with modern web development practices.

Can I create a complete website with just HTML?

Yes, You can build a simple website with just HTML, but it will be very basic. For a visually appealing and interactive website, you’ll also need CSS (for styling) and JavaScript (for dynamic elements). Consider a content management system (CMS) for larger, more complex websites.



Similar Reads

HTML | DOM HTML Object
The HTML Object property in HTML DOM is used to represent or access the HTML &lt;html&gt; element with in the object. The &lt;html&gt; element is used to return the HTML document as an Element Object. Syntax: It is used to access a &lt;html&gt; element.var x = document.getElementsByTagName("HTML")[0]; It can also be used to access a &lt;html&gt; el
3 min read
HTML | &lt;html&gt; xmlns Attribute
The HTML &lt;html&gt; xmlns Attribute is used to specify the xml namespace for a document. Important Note: This attribute is mainly required in XHTML, not valid in HTML 4.01, and optional in HTML 5. Syntax: &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; Attribute Values: https://www.geeksforgeeks.org/ It defines the namespace to use (for XHTML d
1 min read
Inline HTML Helper - HTML Helpers in ASP.NET MVC
HTML Helpers are methods that returns HTML strings. These are used in the view. In simple terms, these are C# methods that are used to return HTML. Using HTML helpers you can render a text box, an area, image tag, etc. In MVC we have many built-in HTML helpers and we can create custom helpers too. Using HTML helpers a view can show model properties
2 min read
How to return HTML or build HTML using JavaScript ?
JavaScript is very powerful and with it, we can build dynamic web content and add many features to a web application. With HTML, we create the structure of the web page and the same thing can also be done with JavaScript. There are a few JavaScript methods called as createElement(), appendChild() with which we can add nodes to the DOM tree on the f
2 min read
How to convert html.slim to html.erb ?
Introduction to slim and erb: Slim files and tools are used to make the code more light and will help to use it instead of the particular code. erb is also used to do the similar but if you want to make the changes in the code then the user should be familiar with slim/erb respectively. If you have to convert an HTML Document into html.slim file th
1 min read
How to include HTML code snippets in HTML ?
In this article, we will learn how to include HTML snippets in HTML code. We will include the HTML code snippet of "gfg.html" into "index.html". To achieve this task, we are going to write a JavaScript function in "index.html" which traverses the collection of all HTML elements in "gfg.html" and searches for elements with specific attributes. It cr
3 min read
How to display HTML tags as plain text in HTML ?
In this article, we will learn how to display HTML tags as plain text in HTML. We can replace the plain text by using &lt; with   &amp;lt; or &amp;60; and &gt;   with  &amp;gt; or &amp;62; on each HTML tag. HTML Entities:Sign DescriptionEntity nameEntity number&lt;Less than(start of HTML element)&amp;lt;&lt;&gt;Greater than(end of HTML element)
2 min read
HTML Complete Guide – A to Z HTML Concepts
What is HTML ? HTML stands for Hypertext Markup Language. It is a standard markup language used to design the documents displayed in the browsers as a web page. This language is used to annotate (make notes for the computer) text so that a machine can understand it and manipulate text accordingly. Most markup languages (e.g. HTML) are human-readabl
7 min read
HTML &lt;html&gt; Tag
HTML is a language full of diverse elements, and one such element is the &lt;html&gt; tag. This tag, standing for ‘HyperText Markup Language’, is used to define the root of an HTML or XHTML document. It serves as the main container for all other HTML elements, excluding the &lt;!DOCTYPE&gt; declaration. Understanding the &lt;html&gt; TagThe &lt;htm
2 min read
HTML Course Basics of HTML
In this article, we will go through all the basic stuff required to write HTML. There are various tags that we must consider and know about while starting to code in HTML. These tags help in the organization and basic formatting of elements in our script or web pages. These step-by-step procedures will guide you through the process of writing HTML.
5 min read
HTML Course Structure of an HTML Document
HTML(Hypertext Markup Language), structures web pages. Unlike programming languages, it isn't compiled or interpreted. Browsers render HTML directly, displaying content without typical errors. It's a markup language, not a programming one, making execution smooth without encountering compilation or interpretation issues. Table of Content HTML Docum
3 min read
What is the difference between &lt;html lang="en'&gt; and &lt;html lang="en-US'&gt; ?
The lang attribute specifies which language is used to write the content of a web page. It is used to set the language for the whole text of the web page. The &lt;html lang="en"&gt; specifies the language of the document as English, while &lt;html lang="en-US"&gt; narrows it down to English as used in the United States. Table of Content The &lt; ht
2 min read
HTML Code to JSON Converter App Using HTML, CSS, and JavaScript
HTML tables are a common way to represent structured data on web pages, but transforming this data into a JSON format can be troublesome. JSON is a lightweight data-interchange format that is easy for humans to read and write and for machines to parse and generate. We will be creating the HTML Code for the JSON Converter tool. The converter is desi
3 min read
Web technologies | HTML and XML | Question 1
Which of the following is an advantage of putting presentation information in a separate CSS file rather than in HTML itself? (A) The content becomes easy to manage (B) Becomes easy to make site for different devices like mobile by making separate CSS files (C) CSS Files are generally cached and therefore decrease server load and network traffic. (
1 min read
HTML | scoped Attribute
The HTML scoped attribute is a boolean attribute that is used to specify that the styles only apply to this element's parent element and that element's child elements (not the entire document).Note : It is a deprecated attribute and it is not supported by HTML5. Supported tag: style Example: C/C++ Code &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head
1 min read
HTML DOM lang Property
In HTML document, the lang property is used to set or return the value of the lang attribute of an element. This attribute specifies the language code of the element's content. The element attribute takes "en" for English, "ja" for Japanese, "es" for Spanish, and so on. The default value of this attribute is unknown. Syntax: Get the value of lang:
2 min read
HTML DOM Style backgroundClip Property
The DOM style backgroundClip Property is used to set or return the painting area of the background. Syntax: It is used to return the backgroundClip property.object.style.backgroundClip It is used to set the backgroundClip property. object.style.backgroundClip = "border-box|padding-box|content-box|initial|inherit" Property Values: border-box propert
1 min read
HTML DOM Style borderTop Property
The DOM style borderTop property is used to set or return the three different border-top property such as border-top-width, border-top-style, and border-top-color of an element. Syntax: It returns the borderTop property. object.style.borderTopIt is used to set the borderTop property. object.style.borderTop = "width style color|initial|inherit" Prop
2 min read
Web technologies Questions | HTML Course | Practice Quiz 2 | Question 1
What is the full form of CSS? (A) Color style sheet (B) Cascading style sheet (C) Creative style sheet (D) Concatenated style sheet Answer: (B) Explanation: Quiz of this QuestionPlease comment below if you find anything wrong in the above post
1 min read
Web technologies Questions | HTML Course | Practice Quiz 2 | Question 7
Which HTML tag is used for internal style sheet? (A) Internal (B) Style (C) CSS (D) Internal Style Answer: (B) Explanation: Quiz of this QuestionPlease comment below if you find anything wrong in the above post
1 min read
Web technologies Questions | HTML Course | Practice Quiz 2 | Question 8
Which of the following is the correct CSS syntax? (A) p:color=green, font-size=15px (B) {p:color=green, font-size=15px} (C) p {color:green, font-size:15px;} (D) p {color:green; font-size:15px;} Answer: (D) Explanation: Quiz of this QuestionPlease comment below if you find anything wrong in the above post
1 min read
Web technologies Questions | HTML Course | Practice Quiz 2 | Question 9
Select the correct among the following for linking an external style sheet. (A) &lt;link rel=“stylesheet” type=“text/css” href=/html-course-practice-quiz-2/>(B) &lt;style rel=“stylesheet” type=“text/css” href=/html-course-practice-quiz-2/>(C) &lt;link&gt;stylesheet (D) &lt;link href=/html-course-practice-quiz-2/> Answer: (A) Explanation: Quiz of th
1 min read
HTML | &lt;th&gt; valign Attribute
The HTML &lt;th&gt; valign Attribute is used to specify the vertical alignment of text content in a header cell. It is not supported by HTML 5. Syntax: &lt;th valign="top | middle | bottom | baseline"&gt; Attribute Value: top: It sets the table header content to top-align. middle: It sets the table header content to middle-align. bottom: It sets th
1 min read
HTML | &lt;col&gt; align Attribute
The HTML &lt;col&gt; align Attribute is used to set the horizontal alignment of text content inside the col element. It is not supported by HTML 5. Syntax: &lt;col align="left | right | center | justify | char"&gt; Attribute Values: left: It sets the text left-align. right: It sets the text right-align. center: It sets the text center-align. justif
1 min read
HTML | DOM Meter max Property
The DOM Meter max Property is used to set or return the value of the max attribute of a gauge. The max attribute is used to specify the upper bound of the gauge and the value of the max attribute must be greater than the value of the min attribute. It has a default value which is 1. Syntax: It return the max property.meterObject.maxIt is used to se
2 min read
HTML | poster Attribute
The HTML poster Attribute is used to display the image while video downloading or when the user clicks the play button. If this image not set then it will take the first frame of video as a poster image.Applicable: It is mainly used in &lt;video&gt; element. Syntax: &lt;video poster="URL"&gt; Attribute Values: It contains a single value URL which s
1 min read
HTML DOM fullscreenerror Event
The HTML DOM fullscreenerror event occurs when an element can not be viewed in full-screen mode, even if it has been requested. Use the element.requestFullscreen() method to view an element in fullscreen mode and the element.exitFullscreen() method to cancel fullscreen mode. Supported Tags It supports all HTML elements. Syntax: In HTML: &lt;element
1 min read
HTML | DOM onvolumechange Event
The onvolumechange event in HTML DOM occurs when the media volume is changed. Use volume property to set/return the volume of the media.This event is invoked by: Volume increasing/decreasingMuting/unmuting the media player Supported Tags &lt;audio&gt;&lt;video&gt; Syntax: In HTML: &lt;element onvolumechange="myScript"&gt;In JavaScript: object.onvol
1 min read
HTML | DOM Input Hidden value Property
The Input Hidden value property in HTML DOM is used to set or return the value of the value attribute of the hidden input field. The value attribute defines the default value of the input hidden field. Syntax: It returns the value property.hiddenObject.valueIt is used to set the value property.hiddenObject.value = text Property Values: This propert
2 min read
HTML DOM onopen Event
The DOM onopen event occurs on an open connection with an event source. Related events: onmessage: Received the message.onerror: The problem occurs. Syntax: Using JavaScript:object.onopen = function(){myScript};Using the addEventListener() method:object.addEventListener("open", myScript); Example: Using the addEventListener() method C/C++ Code &lt;
1 min read