Recent Post

Friday, 28 August 2026

Complete HTML Notes By Pratap Sanjay Sir

Complete HTML Notes
💻 Computer World

Complete HTML Notes

Master HyperText Markup Language with Paragraph Notes, Pure Source Codes & Live Rendered Outputs for Every Single Tag.

📖 35 Core Topics 🎯 Exam-Oriented Theory 💡 Interactive Previews 👨‍🏫 Prepared by Pratap Sanjay Sir

📘 Introduction to HTML

HTML stands for HyperText Markup Language. It is a markup language used to create and structure web pages.

Web Page: A web page is a document created using HTML and displayed in a web browser.

URL stands for Uniform Resource Locator. It is the address used to locate a web page or resource on the Internet.

Father of HTML: Tim Berners-Lee developed HTML in 1991 and invented the World Wide Web (WWW) in 1989.

HTML Element: An element generally consists of an opening tag, content, and closing tag, such as <p>Hello</p>.

HTML Tags: Tags are keywords written inside angle brackets, such as <p>.

Types of Tags: HTML tags are mainly of two types: Container Tags, which have opening and closing tags, and Empty Tags, which do not require a closing tag.

Examples: Container Tag – <p>...</p> | Empty Tag – <br>, <hr>, <img>

1. Heading Tags

<h1> to <h6> Container Tag
📝 Theory & Notes:

Heading tags are used to define main headings and subheadings on a web page. HTML provides six levels of headings starting from <h1> up to <h6>.

The <h1> tag represents the most important and largest heading on the page, whereas <h6> represents the least important and smallest heading.

All heading tags are container tags requiring opening and closing tags. Web browsers automatically insert top and bottom margins (blank space) around every heading element.

💻 HTML Code:
<h1>Welcome in My Page</h1> <h2>This page is dedicated to Class 8th</h2> <h3>This is Heading 3</h3> <h4>This is Heading 4</h4> <h5>This is Heading 5</h5> <h6>This is Heading 6</h6>
🌐 Output Preview:

Welcome in My Page

This page is dedicated to Class 8th

This is Heading 3

This is Heading 4

This is Heading 5
This is Heading 6

2. Paragraph Tag

<p> Container Tag
📝 Theory & Notes:

The <p> tag is used to create and structure standard paragraphs of text on a web page.

It is a block-level container tag that always begins on a fresh new line. Web browsers automatically add an empty line before and after every paragraph block.

Multiple consecutive spaces and line breaks inside the code are collapsed into a single space by the browser when rendered.

💻 HTML Code:
<p>Hello my dear friends, how are you in Computer Room?</p> <p>Now we are starting HTML Coding.</p> <p>HTML stands for HyperText Markup Language. It is used to create the structure of a web page.</p>
🌐 Output Preview:

Hello my dear friends, how are you in Computer Room?

Now we are starting HTML Coding.

HTML stands for HyperText Markup Language. It is used to create the structure of a web page.

3. Line Break Tag

<br> Empty / Void Tag
📝 Theory & Notes:

The <br> tag inserts a single line break right at the position where it is placed in the text.

Unlike the paragraph tag, it does not create extra top or bottom margins. It simply shifts the upcoming content to the beginning of the next line.

It is an Empty Tag (Void Tag), which means it does not contain content and never uses a closing tag like </br>. It is ideal for poems, short addresses, and verses.

💻 HTML Code:
<p> My name is Rahul.<br> I am a student.<br> I am learning HTML. </p>
🌐 Output Preview:

My name is Rahul.
I am a student.
I am learning HTML.

4. Horizontal Rule Tag

<hr> Empty / Void Tag
📝 Theory & Notes:

The <hr> tag draws a horizontal dividing line across the width of the webpage.

It is used as a visual thematic break between different sections, topics, or paragraphs to keep content neat and organized.

Just like <br>, it is an Empty Tag that does not require any closing tag.

💻 HTML Code:
<p>This is the first section.</p> <hr> <p>This is the second section.</p>
🌐 Output Preview:

This is the first section.


This is the second section.

5. Bold Tag

<b> Container / Inline Tag
📝 Theory & Notes:

The <b> tag renders the enclosed text in bold font, making it appear darker and thicker than normal text.

It is purely a visual formatting tag and does not add semantic or special linguistic importance to the text.

It is an inline container tag that must always be properly closed with </b>.

💻 HTML Code:
<p><b>This is Bold Text</b></p>
🌐 Output Preview:

This is Bold Text

6. Italic Tag

<i> Container / Inline Tag
📝 Theory & Notes:

The <i> tag displays text in italic (slanted) font style.

It is typically used for technical terms, foreign expressions, book or movie titles, and creative writing phrases.

It is an inline container element that is closed with </i>.

💻 HTML Code:
<p><i>This is Italic Text</i></p>
🌐 Output Preview:

This is Italic Text

7. Underline Tag

<u> Container / Inline Tag
📝 Theory & Notes:

The <u> tag places a continuous straight underline under the enclosed words or sentences.

It is commonly used to draw attention to key points, definitions, or grammatical errors in study notes.

Because hyperlinks are also underlined by default, use <u> carefully to avoid confusing readers.

💻 HTML Code:
<p><u>This is Underlined Text</u></p>
🌐 Output Preview:

This is Underlined Text

8. Strong Tag

<strong> Semantic Container Tag
📝 Theory & Notes:

The <strong> tag indicates that the enclosed text has high semantic importance, seriousness, or urgency.

While standard browsers display strong text in bold font just like <b>, <strong> gives meaningful information to search engines and screen readers.

Screen-reading software reads out text inside <strong> tags with increased vocal emphasis.

💻 HTML Code:
<p><strong>This is Important Text</strong></p>
🌐 Output Preview:

This is Important Text

9. Emphasis Tag

<em> Semantic Container Tag
📝 Theory & Notes:

The <em> tag is used to give stressed grammatical emphasis to a specific word or phrase inside a sentence.

Visually, web browsers render emphasized text in italic style. However, it carries true semantic meaning compared to the simple styling tag <i>.

It is an inline container tag and must always end with a closing </em> tag.

💻 HTML Code:
<p><em>This text is emphasized.</em></p>
🌐 Output Preview:

This text is emphasized.

10. Mark / Highlight Tag

<mark> Container / Inline Tag
📝 Theory & Notes:

The <mark> tag highlights the enclosed text with a bright yellow background color by default.

It works just like a physical fluorescent highlighter pen used in school notebooks to mark key phrases, exam answers, or search keywords.

It is an inline tag and must be closed using </mark>.

💻 HTML Code:
<p>This is <mark>Highlighted Text</mark>.</p>
🌐 Output Preview:

This is Highlighted Text.

11. Small Text Tag

<small> Container / Inline Tag
📝 Theory & Notes:

The <small> tag renders the enclosed text one size smaller than the surrounding default text size.

It is widely used for secondary information such as copyright notices, disclaimers, terms and conditions, and fine print footnotes.

It is an inline container element closed with </small>.

💻 HTML Code:
<p>Normal Text <small>This is Small Text</small></p>
🌐 Output Preview:

Normal Text This is Small Text

12. Deleted Text Tag

<del> Container / Inline Tag
📝 Theory & Notes:

The <del> tag indicates text that has been removed or deleted from a web document.

Browsers display deleted text with a horizontal line struck right through the center (strikethrough effect).

It is very popular on e-commerce shopping websites to showcase original product prices before a discount.

💻 HTML Code:
<p>Old Price: <del>₹500</del></p>
🌐 Output Preview:

Old Price: ₹500

13. Inserted Text Tag

<ins> Container / Inline Tag
📝 Theory & Notes:

The <ins> tag indicates newly added or inserted text in an updated document.

Web browsers render inserted text with an underline to show that it replaces older content.

It is commonly used together with <del> to clearly display price cuts and document revisions.

💻 HTML Code:
<p>New Price: <ins>₹400</ins></p>
🌐 Output Preview:

New Price: ₹400

14. Superscript Tag

<sup> Container / Inline Tag
📝 Theory & Notes:

The <sup> tag shifts the enclosed text half a character height above the normal text baseline with a reduced font size.

It is essential for writing mathematical exponents like $X^2 + Y^2$ as well as ordinal indicators in dates like $1^{st}, 2^{nd}, 8^{th}$.

It is an inline container tag that must be properly closed with </sup>.

💻 HTML Code:
<p>Example: X<sup>2</sup> + Y<sup>2</sup></p>
🌐 Output Preview:

Example: X2 + Y2

15. Subscript Tag

<sub> Container / Inline Tag
📝 Theory & Notes:

The <sub> tag lowers the enclosed text half a character height below the standard baseline in a smaller size.

It is most frequently used for scientific and chemical formulas like $H_2O, CO_2, H_2SO_4$ and math logarithms like $\log_{10}$.

It is an inline container tag that must be ended with </sub>.

💻 HTML Code:
<p>Example: H<sub>2</sub>O</p>
🌐 Output Preview:

Example: H2O

16. Ordered List

<ol>, <li> List Container
📝 Theory & Notes:

An Ordered List created with the <ol> tag is used when the sequence or order of items is important.

Each list item inside the parent list is wrapped within a <li> (List Item) tag.

By default, web browsers automatically number the items using standard Arabic numerals (1, 2, 3, etc.).

💻 HTML Code:
<p><b>Which class do you read?</b></p> <ol> <li>Class - 7</li> <li>Class - 8</li> <li>Class - 9</li> <li>Class - 10</li> </ol>
🌐 Output Preview:

Which class do you read?

  1. Class - 7
  2. Class - 8
  3. Class - 9
  4. Class - 10

17. Unordered List

<ul>, <li> List Container
📝 Theory & Notes:

An Unordered List created with the <ul> tag produces a bulleted list where item order does not matter.

Just like ordered lists, every item inside the list is defined using the <li> tag.

By default, browsers display solid black circular bullets (disc shape) next to each item.

💻 HTML Code:
<p><b>My Favourite Subjects</b></p> <ul> <li>Computer</li> <li>Mathematics</li> <li>Science</li> <li>English</li> </ul>
🌐 Output Preview:

My Favourite Subjects

  • Computer
  • Mathematics
  • Science
  • English

18. Description List

<dl>, <dt>, <dd> Definition List
📝 Theory & Notes:

A Description List (<dl>) organizes terms alongside their corresponding definitions or explanations.

The <dt> tag defines the term/title, while the <dd> tag provides the indented description data.

This structure is perfect for glossaries, dictionaries, and key term summaries in school notes.

💻 HTML Code:
<p><b>Computer Terms</b></p> <dl> <dt>HTML</dt> <dd>HyperText Markup Language</dd> <dt>CSS</dt> <dd>Cascading Style Sheets</dd> <dt>WWW</dt> <dd>World Wide Web</dd> </dl>
🌐 Output Preview:

Computer Terms

HTML
HyperText Markup Language
CSS
Cascading Style Sheets
WWW
World Wide Web

19. Anchor / Link Tag

<a href="..."> Hyperlink Tag
📝 Theory & Notes:

The <a> (Anchor) tag creates clickable hyperlinks connecting to other webpages, files, or external websites.

Its mandatory attribute is href (Hypertext Reference), which holds the destination target URL address.

Adding the optional attribute target="_blank" instructs the browser to open the link in a fresh new tab.

💻 HTML Code:
<p><b>Visit Google:</b></p> <a href="https://www.google.com" target="_blank"> Click Here to Visit Google </a>
🌐 Output Preview:

20. Image Tag

<img src="..."> Empty Tag
📝 Theory & Notes:

The <img> tag is an empty void tag used to embed images and graphics directly into a webpage.

Key attributes include src (image file source/path), alt (alternative text shown if loading fails), and width / height to specify pixel dimensions.

Since it is an empty tag, it does not have a closing tag.

💻 HTML Code:
<p><b>My Image</b></p> <img src="image.jpg" alt="My Image" width="300">
🌐 Output Preview:

My Image

Rendered Image: image.jpg (width: 300px)

21. Division Tag

<div> Block-level Container
📝 Theory & Notes:

The <div> (division) tag is a generic block-level container element used to group together larger sections of HTML.

It occupies the full width of its parent element and always starts on a fresh new line.

It is primarily used as a styling and layout container with CSS to structure modern webpage designs.

💻 HTML Code:
<div style="background:#e0f2fe; padding:15px; border-radius:8px;"> <h2>About My School</h2> <p>My school is a beautiful place where I learn new things every day.</p> </div>
🌐 Output Preview:

About My School

My school is a beautiful place where I learn new things every day.

22. Span Tag

<span> Inline Container
📝 Theory & Notes:

The <span> tag is a generic inline container used to style or manipulate a specific small portion of text within a line.

Unlike <div>, it does not force a new line and takes up only as much width as its content requires.

It is commonly paired with CSS to colorize or highlight individual words in a paragraph.

💻 HTML Code:
<p> My favourite colour is <span style="color:blue; font-weight:bold;">Blue</span>. </p>
🌐 Output Preview:

My favourite colour is Blue.

23. Table Tag

<table>, <tr>, <th>, <td> Tabular Grid
📝 Theory & Notes:

Tables organize structured data into an intuitive grid made of rows and columns.

The <table> tag encloses the entire table. The <tr> tag creates horizontal rows, <th> creates bold centered header cells, and <td> creates standard data cells.

Use the border attribute on the table tag to define visible outline borders around cells.

💻 HTML Code:
<h2>Student Details</h2> <table border="1"> <tr> <th>Name</th> <th>Class</th> <th>Roll No.</th> </tr> <tr> <td>Rahul</td> <td>8</td> <td>01</td> </tr> <tr> <td>Aman</td> <td>8</td> <td>02</td> </tr> <tr> <td>Priya</td> <td>8</td> <td>03</td> </tr> </table>
🌐 Output Preview:

Student Details

Name Class Roll No.
Rahul 8 01
Aman 8 02
Priya 8 03

24. Form Tag

<form>, <input> User Input Form
📝 Theory & Notes:

The <form> tag creates an interactive web form to collect user inputs and send them to a server.

The versatile <input> tag creates different input fields based on its type attribute (text, email, password, number, submit).

The placeholder attribute shows helpful sample hint text inside the field before the user begins typing.

💻 HTML Code:
<h2>Student Registration Form</h2> <form> <label>Name:</label> <input type="text" placeholder="Enter your name"> <label>Email:</label> <input type="email" placeholder="Enter your email"> <label>Password:</label> <input type="password" placeholder="Enter password"> <label>Age:</label> <input type="number" placeholder="Enter age"> <input type="submit" value="Submit"> </form>
🌐 Output Preview:

Student Registration Form

25. Button Tag

<button> Interactive Control
📝 Theory & Notes:

The <button> tag creates a clickable push button control on a web page.

It can contain text, icons, or images inside its opening and closing tags.

It is commonly linked to JavaScript event listeners (like onclick) to execute interactive scripts or display alert popup messages.

💻 HTML Code:
<button onclick="alert('Hello Class 8!')"> Click Me </button>
🌐 Output Preview:

26. Textarea Tag

<textarea> Multi-line Input
📝 Theory & Notes:

The <textarea> tag allows users to enter multiple lines of text, unlike standard single-line text inputs.

It is ideal for collecting postal addresses, user feedback, reviews, and long descriptive messages.

You can set its initial visible height and width using the rows and cols attributes.

💻 HTML Code:
<h2>Write Your Message</h2> <textarea rows="5" cols="40"> Write your message here... </textarea>
🌐 Output Preview:

Write Your Message

27. Select / Dropdown Tag

<select>, <option> Dropdown Menu
📝 Theory & Notes:

The <select> tag creates a compact drop-down list menu for users to choose from.

Each individual choice option within the drop-down menu is defined using the <option> tag.

Adding the selected attribute to an option sets it as the default visible choice on page load.

💻 HTML Code:
<h2>Select Your Class</h2> <select> <option>Class 6</option> <option>Class 7</option> <option selected>Class 8</option> <option>Class 9</option> <option>Class 10</option> </select>
🌐 Output Preview:

Select Your Class

28. Checkbox Control

<input type="checkbox"> Multiple Choice Input
📝 Theory & Notes:

Checkboxes created with <input type="checkbox"> allow users to select multiple options simultaneously from a given list.

A user may check zero, one, or several boxes independently without affecting other options.

Use the checked attribute to make an option selected by default when the form loads.

💻 HTML Code:
<h2>Select Your Hobbies</h2> <label><input type="checkbox" checked> Reading</label> <label><input type="checkbox"> Playing</label> <label><input type="checkbox"> Drawing</label>
🌐 Output Preview:

Select Your Hobbies

29. Radio Button

<input type="radio"> Single Choice Input
📝 Theory & Notes:

Radio buttons created with <input type="radio"> permit users to choose only one option from a mutually exclusive group.

Crucial Rule: All radio button options belonging to the same group must share the exact same name attribute to link them together properly.

Selecting one radio option automatically deselects any previously selected radio option in the same group.

💻 HTML Code:
<h2>Select Your Gender</h2> <label><input type="radio" name="gender" value="male" checked> Male</label> <label><input type="radio" name="gender" value="female"> Female</label>
🌐 Output Preview:

Select Your Gender

30. HTML Comment

<!-- Comment --> Code Documentation
📝 Theory & Notes:

HTML comments are completely ignored by the web browser and are never rendered on the visible web page.

They are used by coders to write explanatory notes, documentation, and reminders inside the source code.

Comment syntax starts with <!-- and concludes with -->.

💻 HTML Code:
<!-- This is an HTML Comment. Comments are not displayed on the web page. They are used to write notes or explanations inside HTML code. --> <p>Visible text on the webpage.</p>
🌐 Output Preview:

Visible text on the webpage. (The comment written above remains invisible on the page.)

31. Marquee Tag

<marquee> Scrolling Text
📝 Theory & Notes:

The <marquee> tag creates horizontally or vertically scrolling text banners across the screen.

It is traditionally taught in school curriculums for demonstrating moving announcement tickers.

In modern web development, smooth CSS animations are preferred over the obsolete marquee tag for better performance.

💻 HTML Code:
<marquee> Welcome to My HTML Page </marquee>
🌐 Output Preview:
Welcome to My HTML Page

32. Center Tag

<center> Alignment Tag
📝 Theory & Notes:

The <center> tag aligns text and contained elements horizontally in the middle of the webpage.

It is a container tag that centers everything wrapped inside it.

In modern web standards, CSS rules like text-align: center; are used instead of the center tag.

💻 HTML Code:
<center> <h2>Welcome Students</h2> </center>
🌐 Output Preview:

Welcome Students

33. Preformatted Text Tag

<pre> Monospace Container
📝 Theory & Notes:

The <pre> tag displays preformatted text, preserving both extra white spaces and exact line breaks typed in the code.

Browsers render text inside <pre> using a fixed-width monospace font like Courier or Consolas.

It is perfect for displaying formatted poems, source code snippets, and ASCII art diagrams.

💻 HTML Code:
<pre> Name : Rahul Class : 8 Subject: Computer </pre>
🌐 Output Preview:
Name   : Rahul
Class  : 8
Subject: Computer

34. Address Tag

<address> Contact Information
📝 Theory & Notes:

The <address> tag is used to specify contact details for the author, creator, or organization of a web page.

Browsers automatically display the enclosed text in italic font and place line breaks before and after the block.

It can include email addresses, physical addresses, telephone numbers, and author names.

💻 HTML Code:
<address> Written by: Rahul<br> Class: 8th<br> School: My School </address>
🌐 Output Preview:
Written by: Rahul
Class: 8th
School: My School

35. Final Summary & Practice

🎓 Revision Box
📝 Class 8 Exam Summary Checklist:

Container Tags require both an opening and a closing tag (for example: <html>, <h1>, <p>, <ol>, <table>).

Empty Tags (or Void Tags) do not take content and do not require closing tags (for example: <br>, <hr>, <img>, <input>).

File Extension: Always save your HTML files with the .html or .htm extension to open and view them inside any web browser.

🎉 Message for Students:

Congratulations! 🚀

You have completed all 35 basic HTML tags and structure concepts for Class 8 Computer Studies.

Keep practising HTML coding daily in Notepad and testing it in your browser! 💻✨

Complete HTML Notes • Computer Coding

Prepared by Pratap Sanjay Sir | Learn HTML with Simple Examples & Practice

© 2026 All Rights Reserved.

No comments:

"कोशिश करो तो सब कुछ हो सकता है, न करो तो कुछ नहीं हो सकता।"