Skip to content

Commit c6b6edc

Browse files
Restyled by prettier-markdown
1 parent 725cb66 commit c6b6edc

File tree

10 files changed

+257
-149
lines changed

10 files changed

+257
-149
lines changed

docs/html/elements-and-tags-html.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ HTML tags are the building blocks of an HTML document. They are enclosed in angl
1616

1717
For example, the `<h1>` tag is used to define a heading, and it is written as `<h1>Heading</h1>`. The opening tag `<h1>` indicates the start of the heading, and the closing tag `</h1>` indicates the end of the heading.
1818

19-
2019
Commonly used HTML Tags:-
2120
![Commonly used HTMl Tags](image.png)
2221

@@ -30,12 +29,12 @@ For example, in the HTML element `<p> This is a paragraph.</p>`, `<p>` and `</p>
3029

3130
## Difference between HTML Elements and HTML Tags
3231

33-
| HTML Tags | HTML Elements |
34-
|-----------|--------------|
35-
| HTML Tags are used to hold HTML Elements | HTML Elements hold the content |
36-
| Enclosed in angle brackets (`<>`) | Consist of opening tag, content, and closing tag |
37-
| Used to define structure and formatting | Can contain text, images, links, or other HTML elements |
38-
| Paired with opening and closing tags | Content placed between opening and closing tags |
32+
| HTML Tags | HTML Elements |
33+
| ---------------------------------------- | ------------------------------------------------------- |
34+
| HTML Tags are used to hold HTML Elements | HTML Elements hold the content |
35+
| Enclosed in angle brackets (`<>`) | Consist of opening tag, content, and closing tag |
36+
| Used to define structure and formatting | Can contain text, images, links, or other HTML elements |
37+
| Paired with opening and closing tags | Content placed between opening and closing tags |
3938

4039
## Conclusion
4140

docs/html/how-html-works.md

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,22 @@ id: how-html-works
33
title: How HTML works with web browsers
44
sidebar_label: How HTML works
55
sidebar_position: 2
6-
tags: [html, web-development, front-end-development, web-design, web-browsers, web-technology, web-pages]
6+
tags:
7+
[
8+
html,
9+
web-development,
10+
front-end-development,
11+
web-design,
12+
web-browsers,
13+
web-technology,
14+
web-pages,
15+
]
716
description: In this tutorial, you will learn about How HTML works with web browsers and how web browsers render HTML content.
817
---
918

1019
<AdsComponent />
1120

12-
> *We have already learned HTML in the previous tutorial. In this tutorial, we will learn about how HTML works with web browsers and how web browsers render HTML content.*
21+
> _We have already learned HTML in the previous tutorial. In this tutorial, we will learn about how HTML works with web browsers and how web browsers render HTML content._
1322
1423
HTML, which stands for HyperText Markup Language, serves as the backbone of the World Wide Web. It is the standard language used to create web pages, providing the structure and content that browsers render for users to interact with. Understanding how HTML works with web browsers is fundamental for anyone diving into web development.
1524

@@ -40,6 +49,7 @@ HTML is a markup language that uses tags to define the structure and content of
4049
<p>This is my first web page.</p>
4150
</BrowserWindow>
4251
</TabItem>
52+
4353
</Tabs>
4454

4555
In this example, the `<h1>` tag creates a heading, and the `<p>` tag creates a paragraph. The browser interprets these tags and displays the content accordingly. HTML tags can be nested within each other to create more complex structures, such as lists, tables, forms, and more.
@@ -54,12 +64,12 @@ When a user requests a web page by entering a URL in the browser's address bar o
5464

5565
1. **Parsing**: The browser parses the HTML document from top to bottom, identifying and interpreting each element and its attributes. It builds a Document Object Model (DOM) tree, which represents the structure of the web page as a hierarchical collection of nodes. Each node corresponds to an HTML element, such as a heading, paragraph, image, or link.
5666

57-
2. **Rendering**: The browser uses the DOM tree to render the web page on the screen. It determines the layout of the page, including the position and size of each element, based on the **CSS** styles applied to the elements. The browser also calculates the visibility of each element, taking into account factors such as z-index, opacity, and overflow.
67+
2. **Rendering**: The browser uses the DOM tree to render the web page on the screen. It determines the layout of the page, including the position and size of each element, based on the **CSS** styles applied to the elements. The browser also calculates the visibility of each element, taking into account factors such as z-index, opacity, and overflow.
5868

59-
:::info
60-
**CSS (Cascading Style Sheets)** is a stylesheet language used to control the presentation of HTML elements on a web page. CSS allows developers to define styles such as colors, fonts, margins, padding, and layout properties to create visually appealing and responsive designs.
69+
:::info
70+
**CSS (Cascading Style Sheets)** is a stylesheet language used to control the presentation of HTML elements on a web page. CSS allows developers to define styles such as colors, fonts, margins, padding, and layout properties to create visually appealing and responsive designs.
6171

62-
:::
72+
:::
6373

6474
3. **Painting**: The browser paints the pixels on the screen according to the layout determined in the rendering step. It combines the content, styles, and layout to create the final visual representation of the web page.
6575

@@ -75,7 +85,7 @@ In addition to rendering HTML content, web browsers handle various resources ass
7585

7686
- **CSS Stylesheets**: Browsers download and apply CSS stylesheets to control the presentation of HTML elements. Stylesheets can be linked externally using the `<link>` tag or embedded within the HTML document using the `<style>` tag.
7787
78-
For example, the following HTML code snippet links an external CSS stylesheet to the web page:
88+
For example, the following HTML code snippet links an external CSS stylesheet to the web page:
7989
8090
<Tabs>
8191
<TabItem value="HTML Code" label="HTML Code">
@@ -96,7 +106,7 @@ In addition to rendering HTML content, web browsers handle various resources ass
96106
97107
</TabItem>
98108
<TabItem value="CSS Code" label="CSS Code">
99-
109+
100110
```css title="styles.css"
101111
body {
102112
font-family: Arial, sans-serif;
@@ -118,14 +128,13 @@ In addition to rendering HTML content, web browsers handle various resources ass
118128
<p style={{color: "#666"}}>This is my first web page.</p>
119129
</BrowserWindow>
120130
</TabItem>
121-
</Tabs>
122-
123131
132+
</Tabs>
124133
125134
- **JavaScript Code**: Browsers execute JavaScript code embedded in the HTML document or linked externally to add interactivity and dynamic behavior to web pages. JavaScript can manipulate the DOM, handle user input, make network requests, and more.
126135
127-
For example, the following HTML code snippet includes a JavaScript file in the web page:
128-
136+
For example, the following HTML code snippet includes a JavaScript file in the web page:
137+
129138
<Tabs>
130139
<TabItem value="HTML Code" label="HTML Code">
131140
@@ -145,7 +154,7 @@ In addition to rendering HTML content, web browsers handle various resources ass
145154
146155
</TabItem>
147156
<TabItem value="JavaScript Code" label="JavaScript Code">
148-
157+
149158
```javascript title="script.js"
150159
document.getElementById("demo").innerHTML = "Hello, JavaScript!";
151160
```
@@ -158,13 +167,13 @@ In addition to rendering HTML content, web browsers handle various resources ass
158167
<p>Hello, JavaScript!</p>
159168
</BrowserWindow>
160169
</TabItem>
161-
</Tabs>
162170
171+
</Tabs>
163172
164173
- **Images and Media**: Browsers download and display images, videos, and audio files embedded in the HTML document using the `<img>`, `<video>`, and `<audio>` tags, respectively. These resources enhance the visual and multimedia content of web pages.
165-
166-
For example, the following HTML code snippet includes an image in the web page:
167-
174+
175+
For example, the following HTML code snippet includes an image in the web page:
176+
168177
<Tabs>
169178
<TabItem value="HTML Code" label="HTML Code">
170179
@@ -189,6 +198,7 @@ In addition to rendering HTML content, web browsers handle various resources ass
189198
<img src="/img/img-5.png" alt="An image" />
190199
</BrowserWindow>
191200
</TabItem>
201+
192202
</Tabs>
193203
194204
By managing these resources efficiently, web developers can create engaging and interactive web pages that deliver a rich user experience. Understanding how HTML works with web browsers and how browsers render content is essential for building modern web applications that meet user expectations and performance standards.
@@ -233,4 +243,4 @@ By understanding the HTML parsing process, web developers can optimize their cod
233243
234244
## Conclusion
235245
236-
In this tutorial, we explored how HTML works with web browsers and how browsers render HTML content to create web pages. HTML serves as the foundation of the World Wide Web, providing the structure and content that browsers interpret and display for users. By understanding the rendering process, handling resources, and ensuring browser compatibility, web developers can create engaging and accessible web applications that deliver a rich user experience.
246+
In this tutorial, we explored how HTML works with web browsers and how browsers render HTML content to create web pages. HTML serves as the foundation of the World Wide Web, providing the structure and content that browsers interpret and display for users. By understanding the rendering process, handling resources, and ensuring browser compatibility, web developers can create engaging and accessible web applications that deliver a rich user experience.

docs/html/html-basics/document-structure.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ tags: [html, web-development, document-structure]
77
description: In this tutorial, you will learn about the structure of an HTML document and how to create a basic HTML document.
88
---
99

10-
<AdsComponent />
10+
<AdsComponent />

docs/html/html-basics/elements-and-tags.md

Lines changed: 52 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ HTML elements are the fundamental components of HTML documents. They consist of
1818
```
1919

2020
In this example:
21+
2122
- `<p>` is the start tag.
2223
- `This is a paragraph.` is the content.
2324
- `</p>` is the end tag.
@@ -31,15 +32,15 @@ Tags are the syntax used to create HTML elements. They are enclosed in angle bra
3132
An HTML document has a specific structure that includes the following elements:
3233

3334
```html
34-
<!DOCTYPE html>
35+
<!doctype html>
3536
<html>
36-
<head>
37+
<head>
3738
<title>Title of the Document</title>
38-
</head>
39-
<body>
39+
</head>
40+
<body>
4041
<h1>Heading</h1>
4142
<p>Paragraph of text.</p>
42-
</body>
43+
</body>
4344
</html>
4445
```
4546

@@ -87,12 +88,12 @@ An HTML document has a specific structure that includes the following elements:
8788

8889
```html
8990
<ul>
90-
<li>Item 1</li>
91-
<li>Item 2</li>
91+
<li>Item 1</li>
92+
<li>Item 2</li>
9293
</ul>
9394
<ol>
94-
<li>First Item</li>
95-
<li>Second Item</li>
95+
<li>First Item</li>
96+
<li>Second Item</li>
9697
</ol>
9798
```
9899

@@ -107,14 +108,14 @@ An HTML document has a specific structure that includes the following elements:
107108

108109
```html
109110
<table>
110-
<tr>
111-
<th>Header 1</th>
112-
<th>Header 2</th>
113-
</tr>
114-
<tr>
115-
<td>Cell 1</td>
116-
<td>Cell 2</td>
117-
</tr>
111+
<tr>
112+
<th>Header 1</th>
113+
<th>Header 2</th>
114+
</tr>
115+
<tr>
116+
<td>Cell 1</td>
117+
<td>Cell 2</td>
118+
</tr>
118119
</table>
119120
```
120121

@@ -132,9 +133,9 @@ An HTML document has a specific structure that includes the following elements:
132133

133134
```html
134135
<form>
135-
<label for="name">Name:</label>
136-
<input type="text" id="name" name="name">
137-
<button type="submit">Submit</button>
136+
<label for="name">Name:</label>
137+
<input type="text" id="name" name="name" />
138+
<button type="submit">Submit</button>
138139
</form>
139140
```
140141

@@ -145,21 +146,21 @@ An HTML document has a specific structure that includes the following elements:
145146
- `<img>`: Embeds an image.
146147

147148
```html
148-
<img src="image.jpg" alt="Description of image">
149+
<img src="image.jpg" alt="Description of image" />
149150
```
150151

151152
- `<audio>`: Embeds audio content.
152153
- `<video>`: Embeds video content.
153154

154155
```html
155156
<audio controls>
156-
<source src="audio.mp3" type="audio/mpeg">
157-
Your browser does not support the audio element.
157+
<source src="audio.mp3" type="audio/mpeg" />
158+
Your browser does not support the audio element.
158159
</audio>
159160

160161
<video controls>
161-
<source src="video.mp4" type="video/mp4">
162-
Your browser does not support the video tag.
162+
<source src="video.mp4" type="video/mp4" />
163+
Your browser does not support the video tag.
163164
</video>
164165
```
165166

@@ -176,24 +177,24 @@ An HTML document has a specific structure that includes the following elements:
176177

177178
```html
178179
<header>
179-
<h1>Welcome to My Website</h1>
180+
<h1>Welcome to My Website</h1>
180181
</header>
181182
<nav>
182-
<ul>
183-
<li><a href="#home">Home</a></li>
184-
<li><a href="#about">About</a></li>
185-
</ul>
183+
<ul>
184+
<li><a href="#home">Home</a></li>
185+
<li><a href="#about">About</a></li>
186+
</ul>
186187
</nav>
187188
<section>
188-
<h2>About Us</h2>
189-
<p>This is the about section.</p>
189+
<h2>About Us</h2>
190+
<p>This is the about section.</p>
190191
</section>
191192
<aside>
192-
<h2>Related Links</h2>
193-
<p>Links to related content.</p>
193+
<h2>Related Links</h2>
194+
<p>Links to related content.</p>
194195
</aside>
195196
<footer>
196-
<p>Footer information goes here.</p>
197+
<p>Footer information goes here.</p>
197198
</footer>
198199
```
199200

@@ -207,59 +208,70 @@ HTML elements can have attributes that provide additional information about the
207208

208209
```html
209210
<a href="https://www.example.com" target="_blank">Visit Example</a>
210-
<img src="image.jpg" alt="Description of image" width="500" height="300">
211+
<img src="image.jpg" alt="Description of image" width="500" height="300" />
211212
```
212213

213214
<AdsComponent />
214215

215-
### Key Points
216+
### Key Points
216217

217218
1. **Structure and Semantics**
219+
218220
- HTML elements define the structure and meaning of web content.
219221
- Semantic elements like `<header>`, `<nav>`, `<article>`, and `<footer>` provide meaning to the page structure.
220222

221223
2. **Hierarchy and Organization**
224+
222225
- HTML uses a nested structure with parent and child elements to organize content.
223226
- Headings (`<h1>` to `<h6>`) establish a content hierarchy, aiding in readability and SEO.
224227

225228
3. **Content Presentation**
229+
226230
- Tags like `<p>`, `<ul>`, `<ol>`, and `<table>` are used to present different types of content such as text, lists, and tabular data.
227231

228232
4. **Interactivity**
233+
229234
- Elements like `<a>`, `<form>`, `<input>`, `<button>`, and `<select>` facilitate user interaction.
230235
- Multimedia elements (`<img>`, `<audio>`, `<video>`) enhance content with images, audio, and video.
231236

232237
5. **Attributes**
233238
- Attributes provide additional information and control behavior of HTML elements.
234239
- Common attributes include `href` for links, `src` for images, `alt` for image descriptions, and `type` for input fields.
235240

236-
### Benefits
241+
### Benefits
237242

238243
1. **Improved Accessibility**
244+
239245
- Semantic HTML helps screen readers and other assistive technologies understand and navigate the content.
240246
- Proper use of elements and attributes like `alt` for images improves accessibility for visually impaired users.
241247

242248
2. **Better SEO (Search Engine Optimization)**
249+
243250
- Search engines rely on HTML structure and semantics to index and rank web pages.
244251
- Proper use of headings, links, and metadata enhances SEO, making content more discoverable.
245252

246253
3. **Consistent Styling**
254+
247255
- HTML elements can be easily styled using CSS, ensuring a consistent look and feel across the website.
248256
- Semantic tags provide hooks for CSS selectors, allowing targeted styling.
249257

250258
4. **Enhanced Usability**
259+
251260
- Forms and interactive elements improve user experience by allowing user input and interaction.
252261
- Navigation elements (`<nav>`) and structured content improve usability and content discoverability.
253262

254263
5. **Cross-Browser Compatibility**
264+
255265
- HTML is a standardized language supported by all modern web browsers.
256266
- Properly structured HTML ensures consistent display and functionality across different browsers and devices.
257267

258268
6. **Maintainability**
269+
259270
- Well-structured HTML is easier to read, understand, and maintain.
260271
- Separation of content (HTML), presentation (CSS), and behavior (JavaScript) promotes cleaner and more maintainable code.
261272

262273
7. **Performance**
274+
263275
- Using appropriate HTML elements and attributes can enhance web performance.
264276
- For example, loading images with the `srcset` attribute and lazy loading can optimize resource loading and improve page speed.
265277

@@ -268,4 +280,5 @@ HTML elements can have attributes that provide additional information about the
268280
- Custom data attributes (e.g., `data-*` attributes) can store additional data for JavaScript manipulation.
269281

270282
## Conclusion
271-
HTML elements and tags are fundamental to creating structured and interactive web pages. Elements form the building blocks of HTML documents, each defined by opening and closing tags that encapsulate content. Tags define the structure and semantics of content, from headings and paragraphs to lists, tables, forms, and multimedia. Understanding how to use these elements and tags allows developers to create visually appealing and functional websites.
283+
284+
HTML elements and tags are fundamental to creating structured and interactive web pages. Elements form the building blocks of HTML documents, each defined by opening and closing tags that encapsulate content. Tags define the structure and semantics of content, from headings and paragraphs to lists, tables, forms, and multimedia. Understanding how to use these elements and tags allows developers to create visually appealing and functional websites.

0 commit comments

Comments
 (0)