Introduction to HTML – History, Structure, Tags, Attributes, Modern Uses & GitHub Deployment Guide

Programming Saurabh Mishra 8 Aug 2025
Introduction to HTML illustration

1. Introduction to HTML

What is HTML?

HTML, short for HyperText Markup Language, is the standard language used to create and structure content on the web. It is the foundation of every website, defining how text, images, videos, links, and other elements appear in a browser. Without HTML, there would be no structured web pages — only plain, unformatted text.

Think of HTML as the skeleton of a webpage. While CSS styles it and JavaScript adds interactivity, HTML builds the basic structure that everything else relies on.

Importance of HTML in Web Development

  • Universal standard – Supported by all web browsers.
  • Easy to learn – Ideal for beginners in programming.
  • Foundation of all websites – Works with CSS and JavaScript to create complete web pages.
  • SEO-friendly – Helps search engines understand your website’s structure.
  • Accessible – Allows developers to create content for all devices, including mobile and assistive technologies.

Simple Definition

HTML is a markup language used to create the structure of web pages, telling the browser what to display and how to display it.

2. History of HTML

Who Created HTML and When

HTML was created by Tim Berners-Lee in 1991 while working at CERN (European Organization for Nuclear Research). His goal was to build a simple system for scientists to share and access documents over the internet.

Versions of HTML and Their Key Features

Version Year Key Features
HTML 1.0 1991 Basic text formatting, simple hyperlinks, images.
HTML 2.0 1995 Forms, tables, improved structure.
HTML 3.2 1997 Support for scripts, applets, and better presentation.
HTML 4.01 1999 Separation of content and design, better accessibility.
XHTML 1.0 2000 Stricter syntax, XML-based HTML.
HTML5 2014 Multimedia support, semantic tags, responsive design features.

HTML5 and Modern Updates

HTML5 is the current standard, designed to handle modern web requirements such as multimedia, mobile compatibility, and application development without extra plugins like Flash.

Key HTML5 Features:

  • Semantic tags like <header>, <footer>, <article>, <section>.
  • Native audio/video support with <audio> and <video> tags.
  • Canvas API for drawing graphics dynamically.
  • Improved forms with new input types (date, email, number, etc.).
  • Offline capabilities using local storage and caching.

HTML5 Example Code:

<!DOCTYPE html>
<html>
<head>
    <title>HTML5 Example</title>
</head>
<body>

<header>
    <h1>Welcome to HTML5</h1>
</header>

<section>
    <p>This is an example of a simple HTML5 page.</p>
    <video width="320" height="240" controls>
        <source src="video.mp4" type="video/mp4">
        Your browser does not support the video tag.
    </video>
</section>

<footer>
    <p>Created with HTML5</p>
</footer>

</body>
</html>
    

3. How HTML Works

Relationship with the Browser

When you load a webpage, your browser downloads the HTML file and uses it to understand what content to show. The browser reads the structure defined by HTML tags — headings, paragraphs, links, images — and renders the page accordingly. Without HTML, the browser wouldn't know what to display or how to organize content on the screen.

Role in Front-End Development

HTML forms the backbone of front-end development. Developers use it to define the structure of a webpage — which elements go where. Then, they apply styling with CSS and add interactivity using JavaScript. Together, these three technologies create a functional and visually appealing experience for users.

How HTML Works with CSS and JavaScript

Here’s how these three technologies collaborate:

  • HTML: Structures content — titles, paragraphs, buttons, images.
  • CSS: Styles elements — colors, fonts, layout, spacing.
  • JavaScript: Adds dynamic behavior — form validation, buttons that react, content that updates on interaction.

Think of it like building a house:

  1. HTML is the framework and layout — walls, doors, windows.
  2. CSS is the decor — paint, flooring, furniture.
  3. JavaScript adds automation — lights that turn on when you enter, security systems, and smart controls.

4. HTML Document Structure

Every HTML page follows a basic structure that tells the browser how to read and display content. Understanding this structure is important for creating well-optimized, accessible, and SEO-friendly webpages.

<!DOCTYPE>

The <!DOCTYPE> declaration defines the HTML version and tells the browser how to interpret the document. In modern web development, we use:

<!DOCTYPE html>

This specifies HTML5, the latest version. It helps browsers render pages correctly and ensures consistency across devices.

<html> Tag

This is the root element of an HTML page. Everything you write — except the <!DOCTYPE> declaration — goes inside the <html> tag. You can also specify the language of your document for better SEO and accessibility:

<html lang="en">
  ...
</html>

<head> Section

The <head> contains metadata — information about the webpage that isn’t directly shown on the page but is important for browsers, search engines, and social media. Examples include page title, meta tags, CSS links, favicon, and scripts.

<meta> Tags

Meta tags provide extra information to search engines and browsers. Common types include:

  • Charset: Defines the character encoding.
    <meta charset="UTF-8">
  • Viewport: Helps with mobile responsiveness.
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
  • Description: Used by search engines to describe your page.
    <meta name="description" content="Learn about HTML structure, tags, and how to create a complete webpage.">
  • Keywords: (Less important today but still sometimes used)
    <meta name="keywords" content="HTML, web development, HTML tutorial">
  • Author: Specifies the creator of the content.
    <meta name="author" content="The Cubicals">
  • Open Graph Tags: Used for better link previews on social media.
    <meta property="og:title" content="Introduction to HTML">
    <meta property="og:description" content="Learn the basics of HTML document structure.">
    <meta property="og:image" content="URL-of-image.jpg">

Adding the right meta tags improves SEO, accessibility, and page sharing across platforms.

Favicon

A favicon is the small icon shown in browser tabs and bookmarks. It improves branding and recognition. You can create a favicon using free tools like: favicon.io or Real Favicon Generator.

Example of adding a favicon:

<link rel="icon" type="image/png" href="favicon.png">

<title> Tag

The <title> defines the title of the page, shown in browser tabs and search results. Keep it short, descriptive, and relevant to your content.

<title>Introduction to HTML - The Cubicals</title>

<body> Tag

The <body> contains all the visible content — headings, paragraphs, images, links, tables, and more. Everything users see on your webpage is placed inside the <body> tag.

Complete Example of a Basic HTML5 Document

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta name="description" content="Learn the basic HTML document structure with examples.">
  <title>HTML Document Structure</title>
  <link rel="icon" type="image/png" href="favicon.png">
</head>
<body>
  <h1>Welcome to HTML</h1>
  <p>This is a simple HTML page example.</p>
</body>
</html>

5. Common HTML Tags

HTML provides a variety of tags to structure and present content on a web page. Each tag has its own purpose and usage. Below are some of the most commonly used HTML tags in web development.

Headings

Headings are used to define titles and sub-titles on a webpage. HTML provides six levels of headings, from <h1> (most important) to <h6> (least important). Search engines give more importance to headings, so they play a key role in SEO. Learn more about headings in detail here: HTML Headings Guide

<h1>Main Heading</h1>
<h2>Sub Heading</h2>
<h3>Minor Heading</h3>

Paragraphs

Paragraphs are written inside the <p> tag. They are used to display text content in a structured way.

<p>This is a sample paragraph.</p>

Links (<a> Tag)

The <a> tag is used to create hyperlinks. It uses the href attribute to define the link URL.

<a href="https://example.com">Visit Example</a>

Images (<img> Tag)

The <img> tag is used to display images. It requires the src attribute for the image path and alt text for accessibility and SEO.

<img src="image.jpg" alt="Description of Image">

Lists

Lists are used to group related items together. HTML supports three main types of lists:

  • Unordered List (<ul>) – Displays items with bullet points.
  • Ordered List (<ol>) – Displays items with numbers.
  • Description List (<dl>) – Displays terms and descriptions.
<ul>
    <li>Item One</li>
    <li>Item Two</li>
</ul>

<ol>
    <li>First</li>
    <li>Second</li>
</ol>

<dl>
    <dt>HTML</dt>
    <dd>HyperText Markup Language</dd>
</dl>

Tables (<table> Tag)

The <table> tag is used to display data in rows and columns. It works with <tr> (table row), <th> (table header), and <td> (table data).

<table border="1">
    <tr>
        <th>Name</th>
        <th>Age</th>
    </tr>
    <tr>
        <td>John</td>
        <td>25</td>
    </tr>
</table>

Forms (<form> Tag)

Forms are used to collect user input. The <form> tag works with input fields, text areas, checkboxes, radio buttons, and submit buttons.

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

These are the fundamental HTML tags that form the base of any webpage. Mastering them is the first step towards becoming proficient in web development.

6. HTML Attributes

HTML attributes provide additional information about HTML elements. They are always included in the opening tag and usually come in name/value pairs like name="value". Attributes help control the behavior, appearance, or identification of elements.

Global Attributes

Global attributes can be used with any HTML element. Some of the most important global attributes include:

  • class: Assigns one or more class names to an element. Classes are used for styling with CSS and for targeting elements with JavaScript.
    Example: <p class="highlight">This is highlighted text.</p>
  • id: Assigns a unique identifier to an element. IDs should be unique within a page and are often used for JavaScript targeting or linking to specific sections.
    Example: <div id="main-section">Content here</div>
  • style: Applies inline CSS styles directly to an element. While it works, using external or internal CSS is preferred for maintainability.
    Example: <h1 style="color:blue;">Blue Heading</h1>

7. Best Practices in HTML

Writing clean, semantic, and properly formatted HTML is essential for better readability, SEO, and maintainability. Below are some important practices to follow:

Write Clean Semantic HTML

Use HTML elements according to their intended meaning. For example, use <header> for the top section of a page, <nav> for navigation menus, and <article> for articles or blog posts. Semantic HTML helps search engines and assistive technologies understand your content better.

Use Proper Indentation

Indentation means adding spaces or tabs before your code lines to create a structured and visually organized document. It makes your HTML easier to read and maintain, especially when working on large projects.

<div>
    <h1>Title</h1>
    <p>Content here</p>
</div>

Close All Tags Properly

Always close your tags to prevent unexpected layout or rendering issues. For example, instead of writing <p>Text, write <p>Text</p>. Even though some HTML tags are optional to close, doing so improves consistency and avoids browser compatibility problems.

Additional Tips

  • Use lowercase for element and attribute names.
  • Quote all attribute values (e.g., class="example").
  • Keep your HTML code well-commented for future reference.
  • Validate your HTML with the W3C Markup Validation Service.

8. HTML in Modern Web Development

HTML remains the foundation of modern web development, serving as the structure upon which CSS, JavaScript, and backend technologies build functional and interactive websites. Even with the rise of frameworks and libraries, HTML is still essential for creating well-structured and accessible web pages.

How HTML Works

HTML (HyperText Markup Language) uses elements and tags to define the structure of web content. It is interpreted by the browser, which then renders text, images, videos, and other components according to the markup. HTML is often used alongside CSS for styling and JavaScript for interactivity.

Responsive Design

Responsive design ensures that web pages look and work well on all devices, from mobile phones to desktop computers. HTML works with CSS media queries and flexible layouts to adjust content according to the screen size.

Example: Using <meta name="viewport" content="width=device-width, initial-scale=1.0"> ensures proper scaling on mobile devices.

Accessibility Considerations

Accessibility ensures that websites are usable by people with disabilities. HTML offers semantic elements and attributes to improve accessibility:

  • Use <alt> text for images to describe content for screen readers.
  • Use headings (<h1> to <h6>) in a logical order.
  • Label form fields using the <label> tag.
  • Ensure proper color contrast for text and background.

Additional Learning and Resources

Once you are comfortable with HTML basics, you can explore practical skills and the broader scope of web development. Here are some useful resources:

How to Upload a Project on GitHub

Learn step-by-step how to create a repository, upload your project, and even deploy a website for free using GitHub Pages. Follow the complete guide here:

Read the full GitHub project upload and deployment guide

Scope of Web Development

Web development is a rapidly growing field with opportunities in frontend, backend, and full-stack development. Explore career options, skill requirements, and industry trends here:

Read the full article on the scope of web development

0 Comments
No comments yet. Be the first to share your thoughts!

Related Blogs in "Programming"

Programming 21 August 2025
SQL & Relational Databases Explained: Basics to Advanced with Examples

Learn SQL and Relational Databases in a simple, step-by-step guide with examples. Covers basics to advanced, queries, normalization, joins, interview questions and more. Perfect for students, developers, and job seekers.

the cubicals Read More
Programming 22 August 2025
MongoDB and NoSQL Databases Explained: Complete Guide for Students and Developers

Learn MongoDB, NoSQL Databases in a simple, descriptive way. Covers basics, core concepts, CRUD, schema design, indexing, aggregation, replication, sharding, use cases, interview Q&A and more. A complete 3000+ words guide for students and developers.

the cubicals Read More