Chapter 010mAI Lab

HTML Introduction — AI Lab

HTML के हो, HTML Elements कसरी काम गर्छन् र सरल उदाहरण तथा अभ्यासहरूको मद्दतले आफ्नो पहिलो HTML Document कसरी बनाउने भन्ने कुरा सिक्नुहोस्।

AI Lab15 min3 prompts

AI ल्याब — AI सँग HTML सिक

HTML कोड जेनरेट, व्याख्या र डिबग गर्न AI प्रभावकारी रूपमा प्रयोग गर्न सिक।

AI ल्याब — AI सँग HTML सिक

यो AI ल्याबमा तपाईं HTML कोड लेख्न, बुझ्न र डिबग गर्न AI प्रभावकारी रूपमा प्रयोग गर्न सिक्नुहुनेछ।

Prompt Lessons

01

आधारभूत HTML पेज जेनरेट गर्नुहोस्

easygenerate

AI लाई शीर्षक, हेडिङ र प्याराग्राफसहित पूर्ण HTML5 कागजात उत्पन्न गर्न भन्नुहोस्।

You will learn
संरचना, सामग्री र HTML5 मापदण्डहरू निर्दिष्ट गर्ने स्पष्ट प्रम्प्ट लेख्न सिक।
Prompt
Try with AI
निम्न आवश्यकताहरूसहित एक मान्य HTML5 कागजात सिर्जना गर्नुहोस्। पूर्ण HTML कागजात फिर्ता गर्नुहोस्।

यो प्रम्प्ट राम्रोसँग काम गर्छ किनभने यसले कागजात प्रकार, सटीक सामग्री आवश्यकता र उपयुक्त संरचना निर्दिष्ट गर्छ।

Expected Output

A complete, valid HTML5 document with proper structure.

Example Output

<!DOCTYPE html>
<html lang="en">
<head>
  <title>My First Web Page</title>
</head>
<body>
  <h1>Welcome to HTML</h1>
  <p>HTML (HyperText Markup Language) is the standard language for creating web pages.</p>
</body>
</html>

Why it works

The prompt is structured, specific, and lists requirements as a checklist.

Common Mistakes

  • Not specifying HTML5 — AI may use HTML4
  • Vague instructions like "make a page"
  • Missing the DOCTYPE requirement

Verification Checklist

  • Has <!DOCTYPE html>
  • Has <html>, <head>, <body> tags
  • Title is in <head>
  • Content is in <body>
  • Valid HTML5 syntax

Follow-up Prompts

  1. Add a navigation menu
  2. Include CSS styling
  3. Add an image
02

AI सँग HTML तत्वहरू बुझ्नु

easyexplain

HTML कोड पेस्ट गर्नुहोस् र AI लाई हरेक तत्वले के गर्छ भनेर व्याख्या गर्न भन्नुहोस्।

You will learn
AI लाई उदाहरणसहित कोड स्पष्ट रूपमा व्याख्या गर्न लगाउन सिक।
Prompt
Try with AI
यो HTML कोड मलाई व्याख्या गर्नुहोस्।

This prompt works because it asks AI to break down each element, explain its purpose, and list attributes.

Expected Output

A clear, element-by-element breakdown of the HTML code with explanations.

Example Output

AI would explain: <div> is a container, <header> is the page header, <nav> contains navigation links, <main> holds primary content, <article> represents a self-contained post.

Why it works

The prompt includes the actual code to explain and asks for a structured breakdown.

Common Mistakes

  • Asking "what is HTML?" without providing code
  • Not specifying what aspects to explain

Verification Checklist

  • AI explains each element
  • Explanations are clear
  • Attributes are mentioned
  • Context is explained

Follow-up Prompts

  1. How do I make this responsive?
  2. What CSS would style this?
03

AI सँग HTML त्रुटिहरू डिबग गर्नुहोस्

mediumdebug

AI लाई बिग्रिएको HTML कोड र त्रुटि विवरण दिनुहोस्, त्यसपछि समस्या खोज्न र सच्याउन भन्नुहोस्।

You will learn
AI लाई प्रभावकारी रूपमा HTML डिबग गर्न पर्याप्त सन्दर्भ दिन सिक।
Prompt
Try with AI
मेरो HTML पेज सही देखाउँदैन।

This debug prompt works well because it provides: the actual code, a description of what's wrong, and specific symptoms. AI can match symptoms to common causes.

Expected Output

AI identifies: missing alt attribute on img, and missing https:// in the href. Provides corrected code.

Example Output

<img src="photo.jpg" alt="My Photo">
<a href="https://www.google.com">Search</a>

Why it works

Providing both the code AND the observed symptoms gives AI maximum context to diagnose the issue.

Common Mistakes

  • Saying "my code is broken" without showing the code
  • Not describing what "broken" means
  • Not providing error messages

Verification Checklist

  • AI identifies both errors
  • Corrected code is provided
  • Explanations for each fix
  • Code is valid HTML5

Follow-up Prompts

  1. How do I add more images?
  2. How do I create a navigation bar?