HTML Introduction

HTML Basics

To introduce HTML let’s start with definition so,

What is HTML?
HTML stands for Hyper Text Markup Language and it used for creating web pages.
HTML consists of a series of elements and describes the structure of Web page.
HTML elements tell the browser how to display the content
HTML elements are represented by tags and these tells how to display the content.

HTML Document Structure:

  • An HTML document is a plain text file with the “.html” file extension.
  • It consists of a series of elements that define the structure and content of the web page.

Below code shows our first HTML document

<!DOCTYPE html>
      <title>Page Title goes here...</title>
      <h1>TechLearnings Heading</h1>
      <p>TechLearnings Paragraph</p>

Basic Structure:

<!DOCTYPE html>

    <title>Page title goes here...</title>

    <h1>This is a Heading</h1>
    <p>This is a paragraph</p>

<div class="tl-list-heading"><span>HTML Tags</span></div>
HTML tags (also called as HTML elements) are surrounded by angle brackets

 <tag_name> Content inside tags... </tag_name>

When HTML pages are rendered on web broswer, browser engine transforms HTML documents and other resources of a web page, into an interactive visual representation on web broswer (or other user's device).

<!DOCTYPE> Declaration

The <!DOCTYPE> declaration represents the document type, and helps browsers to display web pages correctly.

  •         <!DOCTYPE html> 

    Declares the document type and version of HTML (HTML5 in this case).

  •  <html> 

    The root element that contains all other HTML elements.


    Contains meta-information about the document, such as the title.

  •  <title> 

    Sets the title of the web page, displayed in the browser's title bar or tab.


    Contains the visible content of the web page.

Headings and Paragraphs:

  • Headings are defined with





    is the highest level and


    is the lowest.

  • Paragraphs are defined with



  • To create a hyperlink, use the <a> (anchor) element.
<a href="">Go to Example</a>


  • To embed an image, use the <img> element.
<img src="image.jpg" alt="Image description">


  • You can create ordered lists ( <ol>) and unordered lists (
  • List items are defined with <li>.
    <li>Item 1</li>
    <li>Item 2</li>
    <li>Item 3</li>


  • Forms are used for user input and interaction.
  • Form elements include <form>, <input>,
    <textarea>, <select>, and more.
<form action="/submit" method="post">
    <input type="text" name="username" placeholder="Username">
    <input type="password" name="password" placeholder="Password">
    <button type="submit">Submit</button>


  • HTML elements can have attributes that provide additional information or settings.
  • Attributes are specified in the opening tag of an element.
<a href="" target="_blank">Go to Example</a>


  • You can add comments to your HTML code using <!-- comment goes here -->. Comments
    are not displayed in the browser but can be helpful for documentation.

HTML is Case-Insensitive:

  • HTML tags and attributes are not case-sensitive, but it's a best practice to use lowercase for tag
    names and attribute names to ensure compatibility.


  • Extra spaces and line breaks are generally ignored in HTML. Use indentation and formatting for


  • HTML documents should be well-formed and follow the HTML specification. You can validate your HTML
    using online tools or integrated development environments (IDEs).

Author: Mahesh

Technical Lead with 10 plus years of experience in developing web applications using Java/J2EE and web technologies. Strong in design and integration problem solving skills. Ability to learn, unlearn and relearn with strong written and verbal communications.