<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Short Example</title> <!-- Single-line comment: This is the title of the page --></head><body> <h1>Hello, World!</h1> <!-- Single-line comment: End of content --></body></html>
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Short Example</title> <!-- Multi-line comment: This section contains the page title. You can add more metadata here. --></head><body> <h1>Hello, World!</h1> <!-- Multi-line comment: This is the main content section. You can add more elements here. --></body></html>
Single line
Multiple line
โค้ดตัวอย่างนี้สั้นลงและเน้นให้เห็นการใช้คอมเมนต์แบบบรรทัดเดียวและหลายบรรทัดใน HTML.