Complete Mastering in HTML โ€“ Learn HTML from Basics to Advanced

Introduction

HTML (HyperText Markup Language) is the standard markup language used to create web pages. It defines theย structureย of a webpage using tags likeย ,<h1>, <b>ย ,<div>ย  etc.

๐Ÿ–ฅ๏ธ How to Run and Create an HTML File

  • Open any text editor like Notepad (Windows), VS Code, or Sublime Text.
  • Create a new file and save it with .html extension โ€” for example: index.html
  • Write HTML code inside this file.
  • To view it, just double-click the file or open it in a browser (like Chrome or Firefox).

๐Ÿงฉ HTML vs CSS vs JS vs Frameworks

HTML โ†’ Structure of the webpage

CSS โ†’ Styling of the webpage

JavaScript โ†’ Adds interaction/logic to the webpage

Frameworks โ†’ Built on top of HTML/CSS/JS to simplify development (like React, Angular)

๐Ÿ’ฌ How to Write Comments in HTML

Use  to write comments.

Comments are not shown on the page but help explain code or leave notes.

Example:

๐Ÿงฑ Basic HTML Structure

<!DOCTYPE html>
<html>
  <head>
    <title>Codingboot firt page</title>
  </head>
  <body>
    <h1>Hello, HTML World!!</h1>
    <p>This is a paragraph.</p>
  </body>
</html>

Output:

Hello, HTML World!!
This is a paragraph.

๐Ÿ”ค Text Formatting Tags

<b>Bold</b> <br>
<strong>Strong</strong><br>
<i>Italic</i><br>
<em>Emphasized</em><br>
<mark>Highlighted</mark><br>
<small>Small Text</small><br>
<del>Deleted</del><br>
<ins>Inserted</ins><br>

Output:

Bold

Strong

Italic

Emphasized

Highlighted

Small Text

Deleted

Inserted

๐Ÿ“‹ Lists in HTML

<ul>
    <li>Java</li>
    <li>PHP</li>
</ul>
<ol type="i">
    <li>Spring Boot</li>
    <li>Laravel
        <ul type="1">
            <li>Eloquent</li>
            <li>Blade</li>
        </ul>
    </li>
</ol>

Output:

๐Ÿ”— Link and Image

<a href="https://example.com">Visit Example</a>
<img src="https://via.placeholder.com/100" alt="Sample Image">

Output:
Visit Example
(Displays a sample image)

๐Ÿงญ HTML Table Basics

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

Output:

๐Ÿงพ Advanced Table (With rowspan, colspan)

<table border="1">
  <tr>
    <th rowspan="2">Name</th>
    <th colspan="2">Contact</th>
  </tr>
  <tr>
    <td>Email</td>
    <td>Phone</td>
  </tr>
  <tr>
    <td>Rohit</td>
    <td>Rothi@gmail.com</td>
    <td>1234567890</td>
  </tr>
</table>

Output:

๐Ÿงพ Form Using Table Layout (Login Example)

<form>
  <table border="1">
    <tr>
      <td>Username:</td>
      <td><input type="text"></td>
    </tr>
    <tr>
      <td>Password:</td>
      <td><input type="password"></td>
    </tr>
    <tr>
      <td colspan="2" align="center"><button>Login</button></td>
    </tr>
  </table>
</form>

Output Preview:

This creates a basic login form where labels and fields are aligned using a table.

๐Ÿงพ Form Example: Registration Page

<form>
    <table border="0" cellspacing="0">
        <tr>
            <td>First Name:</td>
            <td><input type="text" name="first_name"></td>
        </tr>
        <tr>
            <td>Last Name:</td>
            <td><input type="text" name="last_name"></td>
        </tr>
        <tr>
            <td>Email:</td>
            <td><input type="email" name="email"></td>
        </tr>
        <tr>
            <td>Address:</td>
            <td><textarea name="address"></textarea></td>
        </tr>
        <tr>
            <td>City:</td>
            <td><input type="text" name="city"></td>
        </tr>
        <tr>
            <td></td>
            <td><button type="submit">Register</button></td>
        </tr>
    </table>
</form>

Output Preview:

๐Ÿงฑ Block vs Inline Elements

<div>This is a block element (div)</div>
<span>This is an inline element (span)</span>

Explanation:

  •  is inline

๐ŸŽ›๏ธ More Semantic Tags

<header>Header Area</header>
<nav>Menu</nav>
<main>Main Content</main>
<footer>Footer Info</footer>

๐ŸŽž๏ธ Marquee Tag (Scrolling Text)

<marquee>Welcome to HTML Tutorial!</marquee>

Output:
๐Ÿ“ข Welcome to HTML Tutorial! (scrolls across the screen)

โš ๏ธ Note:  is outdated and not supported in HTML5.
โœ… Alternative: Use CSS animations for scrolling effects.

โœ… Summary

  • Structure your webpage using HTML tags
  • Use  with rowspan and colspan for complex forms
  • Use semantic tags to improve clarity
  • Avoid outdated tags like  in modern development