By the end of this tutorial, you will understand :
HTML (HyperText Markup Language) is the foundation of all web pages. It conveys to the browser what to display and the structure of the content in the page.
Without HTML you cannot write a web page or build a website. The knowledge of HTML gives you the ability to create the basic structure of any website.
HTML is an acronym for HyperText Markup Language. It utilizes “tags” to explain how content on the web should appear in a browser.
A web browser will read the tags and display the page accordingly.
Example:
<!DOCTYPE html>
<html>
<head>
<title>My First Web Page</title>
</head>
<body>
<h1>Hello World!</h1>
<p>This is my first HTML page.</p>
</body>
</html>
Brief Summary:
You can write HTML in any text editor, like Notepad, VS Code, or Sublime Text. Next, save the file with a .html extension (for example, index.html) and open it in a browser.
Example basic structure:
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>Main Heading</h1>
<p>Paragraph text goes here.</p>
</body>
</html>
An HTML element is usually made up of a start tag, the content itself, and an end tag. Attributes provide additional information concerning an element.
Example:
<p style="color:red;">This is a red paragraph.</p>
HTML has 6 levels of headings (<h1> to <h6>). Paragraphs are created using the <p> tag.
<h1>This is a main heading</h1>
<h2>This is a subheading</h2>
<p>This is a paragraph of text.</p>
Inline styles are used to change an element’s appearance.
<p style="color:blue; font-size:18px;">This is blue text.</p>
<b>Bold</b>, <i>Italic</i>, and <u>Underline</u> are used for formatting text.
Comments are text that is not rendered in the browser that can help you or someone else understand your code.
Example:
<!-- This is a comment -->
1. Create a .html file, and add your name to the title.
2. Add two headings, and a paragraph
3. Make one word bold, and another italicized
4. Add a comment: “This is my first webpage!”
In this lesson, you learned how HTML builds a page with elements, attributes, and tags, and wrote some headings, paragraphs, and inline styles. You also learned how to write a comment and have a better understanding of what to avoid doing when building HTML.
LeetCode and Practice References
– LeetCode HTML Basics Practice: https://leetcode.com/problemset/all/?topicSlugs=html
– W3Schools HTML Tutorial:
https://www.w3schools.com/html/
Source Code:
HyperText Markup Language or HTML is the coding language that is commonly used to create web pages. HTML is responsible for the structure and layout of any website you access, from blogs to e-commerce. Everything on the world wide web is based on HTML as the primary foundation.
<!DOCTYPE html> is an instruction for the browser to indicate this webpage is an HTML5 document (the latest version of HTML). It helps to render correctly across all modern browsers.
Tag: The code containing the angle brackets, like <p> or </p>.
Element: The entire structure; the opening tag, content, and closing tag. For example, <p>Hello World</p> That's an element.
The <head> section has the meta-data, such as the page title, links to stylesheets, and scripts.
The <body> section contains all the visible content such as text, images, buttons, and links.
Yes! You can write HTML in Notepad, VS Code, Sublime Text, or Atom. However, we suggest using Visual Studio Code for beginners as it has syntax highlighting.
Copyright © 2025 Niotechone Software Solution Pvt. Ltd. All Rights Reserved.