HTML

HTML Basics and DOM Structure

HTML Overview

Example HTML Page

<!DOCTYPE html>
<html>
    <head>
        <title>Page Title</title>
    </head>
    <body>
        <h1>A Heading</h1>
        <p>A Paragraph</p>
    </body>
</html>

Output:
Pasted image 20250922121252.png|500

HTML Element Tree Structure

document
 └── html
     ├── head
     │   └── title
     └── body
         ├── h1
         └── p

Each element can contain other HTML elements, while the main HTML tag should contain all other elements within the page, which falls under document, distinguishing between HTML and documents written for other languages, such as XML documents.

HTML Tag Syntax

URL Encoding (Percent-Encoding)

Character Encoding
space %20
! %21
" %22
# %23
$ %24
% %25
& %26
' %27
( %28
) %29
A full character encoding table can be seen here.

Important HTML Elements

Document Object Model (DOM)

DOM Parts

Accessing Elements

Usage in Security


Exercise

What is the HTML tag used to show an image?

flag: <img>