View Categories

HTML Tutorial

HTML (HyperText Markup Language) is the backbone of the web, used by billions of websites to structure and display content. In this tutorial, you will learn how to create web pages using HTML from scratch. By the end of this guide, you’ll have a solid foundation in HTML and be prepared to explore more advanced web development technologies.

What is HTML? #

HTML stands for HyperText Markup Language and is the standard language for creating and designing web pages. Introduced by Tim Berners-Lee in 1991, HTML has evolved through various versions, with HTML5 being the latest iteration in 2024.

  • HyperText defines the links between web pages.
  • Markup Language defines the text within tags, which gives structure to web pages.

Why Learn HTML? #

Here are some of the key reasons to learn HTML:

  1. Foundation of Web Structure:
    HTML provides the structural skeleton of all web pages, helping browsers understand how to display content like text, images, and multimedia.
  2. Easy to Learn:
    HTML is beginner-friendly, with simple tags and syntax, making it an ideal starting point for anyone interested in web development.
  3. Gateway to Web Development:
    Mastering HTML is the first step toward learning CSS (for styling) and JavaScript (for interactivity).
  4. Broad Applications:
    With HTML, you can build websites, email templates, newsletters, and more.
  5. Creative Freedom:
    HTML allows you to bring your ideas to life online, giving you the freedom to create whatever you can imagine.

HTML Basics #

Before diving into advanced concepts, it’s essential to understand the basics of HTML. HTML uses tags to structure content. Tags are enclosed in angle brackets like <tagname>. Most tags come in pairs: an opening tag <h1> and a closing tag </h1>.

Basic HTML Tags #

  • <html>: Defines the root of an HTML document.
  • <head>: Contains metadata about the HTML document.
  • <body>: Contains the visible content of the webpage.
  • <h1> to <h6>: Heading tags, <h1> is the largest, and <h6> is the smallest.
  • <p>: Paragraph tag, used to define blocks of text.
  • <a>: Anchor tag, used to create hyperlinks.
  • <img>: Used to embed images.

HTML Example – Hello World!

<!DOCTYPE html> 
<html> 
<head> 
    <title>HTML Tutorial</title> 
</head> 
<body> 
    <h1>Welcome to HTML</h1> 
    <p>Hello World! This is my first web page.</p> 
</body> 
</html>

HTML Tags and Attributes #

HTML is made up of tags and attributes. While tags define the structure of the content, attributes provide additional information about elements.

  • HTML Elements: <tagname>content</tagname> (e.g., <p>This is a paragraph.</p>)
  • Attributes: Attributes are added inside the opening tag to provide more information. Example: <img src="image.jpg" alt="Description">.

Common HTML Tags #

  • <div>: Defines a division or section in a document.
  • <span>: Used to group inline elements.
  • <a>: Anchor tag, creates hyperlinks.
  • <img>: Used to embed images.
  • <ul>: Unordered list.
  • <ol>: Ordered list.
  • <li>: List item.

HTML Tables #

HTML tables allow you to organize data into rows and columns, making it easy to display structured information.

Table Example:

<table>
  <tr>
    <th>Name</th>
    <th>Age</th>
  </tr>
  <tr>
    <td>John</td>
    <td>30</td>
  </tr>
  <tr>
    <td>Jane</td>
    <td>25</td>
  </tr>
</table>

Tags used in tables:

  • <table>: Defines the table.
  • <tr>: Table row.
  • <th>: Table header.
  • <td>: Table data cell.

HTML Lists #

Lists help to organize content, making it easier to follow. There are three types of lists in HTML:

  1. Unordered List (<ul>) – Bulleted items.
  2. Ordered List (<ol>) – Numbered items.
  3. Description List (<dl>) – Describes terms.

List Example:

<ul>
  <li>Item 1</li>
  <li>Item 2</li>
  <li>Item 3</li>
</ul>

HTML Forms #

Forms in HTML allow users to input data, such as names, email addresses, and messages. These are used for submitting data to web servers.

Form Example:

<form action="/submit" method="post">
  <label for="name">Name:</label>
  <input type="text" id="name" name="name">
  <button type="submit">Submit</button>
</form>

Common form elements:

  • <form>: Defines the form.
  • <input>: Collects user data.
  • <label>: Defines labels for form elements.
  • <button>: Used to submit the form.

HTML5 and Advanced Concepts #

Once you’re comfortable with the basics, HTML5 introduces new and advanced features to build more dynamic and interactive web pages.

Key HTML5 Features: #

  • Forms: Enhancements in form controls, input types, and validation.
  • Multimedia: Native support for audio and video elements using <audio> and <video>.
  • APIs: Features like Geolocation, Web Storage, and Web Workers.
  • Canvas: 2D drawing with the <canvas> element.
  • Semantic Tags: Elements like <article>, <section>, <nav>, and <footer> provide better content structure.

Want to learn HTML with an instructor, either offline or online? Find experienced tutors near you and join Coaching Wallah—completely free for students!

Leave your comment