Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 85 additions & 13 deletions docs/web-developement/html/html-0.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,63 @@ Hey, everyone! In this guide, we’re going to explore **HTML (HyperText Markup

### Key Features of HTML:

- **Structural Language**: It organizes content on a webpage using elements like headings, paragraphs, lists, and more.
- **Semantics**: HTML5 introduced semantic elements like `<header>`, `<section>`, and `<footer>` that define the meaning of content.
- **Media Integration**: Easily embeds images, videos, audio, and more.

- **Structural Language**:
HTML uses **tags** to organize content into sections like headers, footers, paragraphs, and lists. Without HTML, web browsers would not know how to display text and images meaningfully.

- **Semantics**:
Modern HTML (HTML5) introduces **semantic elements** like:
- `<article>` for blog posts or news stories
- `<section>` for dividing pages into parts
- `<nav>` for navigation menus
These tags add **meaning** to the content, improving SEO and accessibility.

- **Media Integration**:
HTML can embed multimedia directly into pages:

```html
<img src="photo.jpg" alt="A beautiful sunset" />
<video controls>
<source src="video.mp4" type="video/mp4" />
</video>
- **Linking Content**: Connects multiple web pages using hyperlinks.

:::tip Fun Fact
HTML was created by **Tim Berners-Lee** in 1991, and it laid the foundation for the modern web!
:::

---

## 2. How Does HTML Work?

When a user accesses a web page, the browser fetches the HTML file and renders it as a visual page. The HTML provides a **blueprint** for the content structure.
When a user accesses a web page — whether by typing a URL, clicking a link, or submitting a form — a complex yet seamless process begins behind the scenes. At the heart of this process is **HTML**, which acts as the **blueprint** for building the page in the browser.

### What Happens Behind the Scenes?

1. **User Requests a Web Page**
This could be from typing a URL like `www.example.com` or clicking on a link.

2. **Browser Sends a Request to the Server**
The browser makes an HTTP(S) request to the web server hosting the website.

3. **Server Responds with HTML (and other files)**
The server returns the requested HTML document, along with assets like CSS, JavaScript, and images.

4. **Browser Parses the HTML**
The browser reads the HTML file line-by-line and builds a **DOM (Document Object Model)** tree that represents the structure of the content.

5. **Page is Rendered**
The browser displays the content on your screen according to the instructions in the HTML, styled by CSS, and made interactive by JavaScript.

---

### HTML Workflow

```mermaid
graph LR
A[User Requests Web Page] --> B[Server Sends HTML]
B --> C[Browser Parses HTML]
C --> D[Web Page Rendered]
C --> D[Browser Builds DOM]
D --> E[Page Rendered Visually]
```

---
Expand Down Expand Up @@ -68,19 +103,56 @@ Let’s look at a basic HTML document that displays a heading and a paragraph.

## 4. Where is HTML Used?

HTML is everywhere on the web. Every website you visit uses HTML in some form.
HTML is **everywhere** on the web. No matter how advanced a website or app looks, its foundation is almost always built with HTML. It’s the **core language** that browsers use to structure and display content.

Below are some of the most common real-world use cases:

---
### 4.1. Web Pages
HTML forms the backbone of any static or dynamic webpage.

HTML is the **fundamental building block** of all websites — from personal blogs to massive enterprise portals.

- Every static or dynamic web page starts with HTML to define the page’s structure.
- Tags like `<header>`, `<footer>`, `<main>`, and `<article>` organize the page content.
- Even visually complex designs or animations ultimately rest on HTML structure.

**Example:**
Landing pages, portfolios, blog articles, homepages, etc.

---
### 4.2. Web Applications
Combined with CSS and JavaScript, HTML powers modern web apps.

### 4.3. Emails
Most email templates use HTML to provide formatted, styled messages.
Modern web applications — like Gmail, Google Docs, or Facebook — use HTML in combination with **CSS** (for styling) and **JavaScript** (for interactivity and logic).

- HTML defines the UI layout and containers.
- Components like buttons, input fields, and menus are rendered using HTML elements.
- Frameworks like **React**, **Vue**, and **Angular** use HTML (or HTML-like syntax) under the hood.

**Example:**
Online banking portals, project management tools (like Trello), e-commerce dashboards, etc.

---
### 4.3. HTML Emails

HTML is used to create **visually rich, styled emails** that go beyond plain text.

- Companies use HTML emails for marketing newsletters, product updates, onboarding emails, and more.
- HTML allows formatting with fonts, colors, images, tables, and buttons.
- Email clients like Gmail and Outlook render these emails based on their HTML code.

**Example:**
Newsletters, order confirmations, password reset emails, product promotions, etc.

---
### 4.4. Documentation & Help Guides

Many technical documentation sites and help centers are powered by HTML.

- Platforms like **Docusaurus**, **GitBook**, and **Read the Docs** generate HTML from Markdown or custom formats.
- HTML ensures structured, searchable, and user-friendly documentation.

### 4.4. Documentation
HTML is used to create online documentation and user manuals.
**Example:**
Developer docs, API references, onboarding guides, FAQs, changelogs, etc.

---

Expand Down