Learn HTML – The Language of Websites!

HTML is like LEGO for websites! You build web pages using pieces called "tags". Let’s learn how!

What is HTML?

HTML stands for Hyper Text Markup Language.

🎨 Imagine this: You are building a LEGO house. Each LEGO block is a piece like a window, door, or wall. Similarly, HTML uses small pieces called tags to build a website!

πŸ’» HTML tells the computer: "This is a heading," "This is a picture," or "This is a link."

🧠 Without HTML: A webpage would be empty and boring. No text, no images, nothing!

πŸ› οΈ Simple Example:
        <h1>Hello! I am learning HTML!</h1>
        <p>HTML is super fun!</p>
            

βœ… This will show:

Hello! I am learning HTML!

HTML is super fun!

✨ Fun Fact: Every website you visit β€” Google, YouTube, games β€” all use HTML!

🎯 Goal for You: By learning HTML, you will be able to make your own web pages with text, pictures, and buttons. Just like magic but made by YOU! 🎩✨

Basic HTML Page Structure

🎨 Think of a webpage like a book!
It has a cover, a title, and pages inside. HTML has a similar structure!

πŸ“„ Basic HTML Layout:
            <!DOCTYPE html>  ➝ Tells the computer this is an HTML5 file.
            <html>
              <head>
                <title>My First Webpage</title>  ➝ Shows the name on browser tab.
              </head>
              <body>
                <h1>Hello, World!</h1>  ➝ Big heading on the page.
                <p>This is my first webpage.</p>  ➝ A paragraph.
              </body>
            </html>
                
🧠 Understand the Parts:
  • <!DOCTYPE html> ➝ Says, "This is an HTML5 file."
  • <html> ➝ The start of the webpage.
  • <head> ➝ Hidden info like the title, styles, or scripts.
  • <title> ➝ The text that appears on the browser tab (not on the page).
  • <body> ➝ Where all the visible things go β€” headings, text, images, buttons.
πŸ’‘ Result on the Webpage:

Hello, World!

This is my first webpage.

πŸš€ Tip: Every webpage starts and ends with <html> and </html> β€” just like opening and closing a book!

HTML Tags (Magic Words!)

Tags are like instructions. Each tag tells the browser what to do!

πŸš€ Common & Fun Tags:
  • <h1> ... </h1> β†’ Biggest Heading (Title)
  • <h2> ... </h2> β†’ A bit smaller heading
  • <h3> ... </h3> β†’ Even smaller heading
  • <p> ... </p> β†’ Paragraph (text block)
  • <img> β†’ Image (shows pictures)
  • <a> ... </a> β†’ Link (click to go somewhere)
  • <button> ... </button> β†’ Button (click me!)
  • <br> β†’ Line break (move to the next line)
  • <hr> β†’ Horizontal line (divider)
  • <ul> ... </ul> β†’ Unordered list (with bullet points)
  • <ol> ... </ol> β†’ Ordered list (with numbers)
  • <li> ... </li> β†’ List item (used inside ul or ol)
  • <div> ... </div> β†’ A box or section
  • <span> ... </span> β†’ A tiny container for text
  • <strong> ... </strong> β†’ Bold text (important)
  • <em> ... </em> β†’ Italic text (emphasis)
  • <video> ... </video> β†’ Play a video
  • <audio> ... </audio> β†’ Play audio/music
🧠 Example: Making a List of Fruits
        <h2>My Favorite Fruits</h2>
        <ul>
          <li>Apple</li>
          <li>Banana</li>
          <li>Mango</li>
        </ul>
          

🍎 This will show:

  • Apple
  • Banana
  • Mango
🎬 Example: Adding a Video
        <video controls>
          <source src="video.mp4" type="video/mp4">
          Your browser does not support the video tag.
        </video>
          

πŸŽ₯ This will show a video player!

HTML Headings

πŸ‘‘ Headings are like titles on your webpage. They help you show what's important!

HTML has 6 types of headings:

  • <h1> β†’ The BIGGEST heading (Main Title)
  • <h2> β†’ Second biggest
  • <h3> β†’ A little smaller
  • <h4> β†’ Even smaller
  • <h5> β†’ Tiny heading
  • <h6> β†’ The smallest heading
✨ Example of Headings:
        <h1>Welcome to My Website</h1>
        <h2>About Me</h2>
        <h3>My Hobbies</h3>
        <h4>I Love Drawing</h4>
        <h5>Sketches</h5>
        <h6>Tiny Text Example</h6>
          

πŸ‘€ This will look like:

Welcome to My Website

About Me

My Hobbies

I Love Drawing

Sketches
Tiny Text Example

πŸ’‘ Tip: Always use <h1> only ONCE on a page for the main title. Then use <h2> to <h6> for sections and smaller topics.

HTML Paragraphs

✏️ A paragraph is how we write normal text on a webpage β€” like sentences or stories!

We use the tag <p> ... </p> to write paragraphs.

✨ Example:
        <p>
          Hello! My name is Alex. I love coding and drawing.
        </p>
          

πŸ‘€ This will show like:

Hello! My name is Alex. I love coding and drawing.

πŸ’‘ Fun Fact:

You can make as many paragraphs as you want by using more <p> tags!

🎨 Example with Two Paragraphs:
        <p>I love making websites.</p>
        <p>My favorite color is blue.</p>
          

πŸ‘€ Looks like:

I love making websites.

My favorite color is blue.

🌟 Tip: Always remember to open the tag with <p> and close it with </p>.

Adding Images in HTML

πŸ“Έ Want to show pictures on your webpage? You can use the <img> tag. It's like saying, "Hey browser, show this picture!"

✨ The <img> tag needs:

  • src β†’ Where the image is (the file name or link)
  • alt β†’ Words that describe the image (helps when image doesn't load)
🧠 Simple Example:
        <img src="cat.png" alt="A cute cat">
          

πŸ‘€ This will show a picture of a cat (if you have a file named cat.png in your folder).

🌐 Example with Online Image:
        <img src="https://example.com/dog.png" alt="A happy dog">
          

🎨 Example Output:

A cute cat

This is a cute cat image!

πŸ’‘ Important Tips:
  • βœ… Always add alt text. It helps if the picture doesn’t load.
  • βœ… Make sure the src is correct (file name or web link).
  • βœ… Images don’t need a closing tag. Just one tag like <img>.

Lists in HTML (Bullet & Number)

πŸ“ Lists help organize things like favorite foods, tasks, or steps!

There are two main types of lists:

  • Unordered List β€” Bullets (β€’)
  • Ordered List β€” Numbers (1, 2, 3...)
πŸ• Example of a Bullet List (Unordered List):
        <ul>
          <li>Pizza</li>
          <li>Ice Cream</li>
          <li>Burger</li>
        </ul>
          

πŸ‘€ It will look like:

  • Pizza
  • Ice Cream
  • Burger
πŸ§‘β€πŸ³ Example of a Number List (Ordered List):
        <ol>
          <li>Wake up</li>
          <li>Brush teeth</li>
          <li>Eat breakfast</li>
        </ol>
          

πŸ‘€ It will look like:

  1. Wake up
  2. Brush teeth
  3. Eat breakfast
βœ… Rules to Remember:
  • Use <ul> for bullet lists.
  • Use <ol> for numbered lists.
  • Each item goes inside <li> (List Item) tags.

Tables in HTML

πŸͺ‘ A table is like a grid where we can show information neatly in rows and columns. Think of it like your classroom seating chart or a timetable!

✨ Basic Table Example:
        <table border="1">
          <tr>
            <th>Name</th>
            <th>Age</th>
            <th>Hobby</th>
          </tr>
          <tr>
            <td>Ava</td>
            <td>8</td>
            <td>Drawing</td>
          </tr>
          <tr>
            <td>Leo</td>
            <td>9</td>
            <td>Playing Football</td>
          </tr>
        </table>
          

πŸ‘€ This looks like:

Name Age Hobby
Ava 8 Drawing
Leo 9 Playing Football
βœ… What These Tags Mean:
  • <table> β€” Starts the table
  • <tr> β€” Table row (a line of boxes)
  • <th> β€” Table heading (bold and centered)
  • <td> β€” Table data (each box or cell)
🎨 You Can Also Add Borders and Styles!
        <table border="1">...</table>
          

Or make it look fancy using CSS!

Simple Forms

✨ A form is like a magic box where people can type information and send it! You see forms when you sign up, search, or send messages on websites.

πŸš€ Example: A Simple Contact Form
        <form>
          <label>Your Name:</label><br>
          <input type="text"><br><br>
        
          <label>Your Email:</label><br>
          <input type="email"><br><br>
        
          <label>Your Message:</label><br>
          <textarea rows="4" cols="30"></textarea><br><br>
        
          <button type="submit">Send Message</button>
        </form>
          

πŸ‘€ This looks like:










πŸ’‘ What These Tags Mean:
  • <form> β€” Starts the form
  • <label> β€” Adds a label (a small text telling what to type)
  • <input> β€” A box where you type
  • type="text" β€” For writing words
  • type="email" β€” For typing an email address
  • <textarea> β€” A bigger box for writing longer messages
  • <button> β€” A button to click
🎨 You Can Style Forms with CSS Too!

Make the form look colorful and pretty with backgrounds, borders, and buttons!

Adding Colors

Colors make websites look happy, bright, and fun! 🌈

We can add colors using something called style.

πŸ–ŒοΈ Example: Make Text Colorful
        <p style="color: red;">I love coding!</p>
          

πŸ‘€ This looks like:

I love coding!

🎨 Example: Change Background Color
        <div style="background-color: yellow; padding: 10px;">
          This has a yellow background!
        </div>
          
This has a yellow background!
🌟 Common Colors You Can Use:
  • red
  • blue
  • green
  • orange
  • purple
  • pink
  • yellow
  • black
πŸ’‘ Formula:

style="color: COLORNAME;" ➝ Changes text color.

style="background-color: COLORNAME;" ➝ Changes background color.

🎯 Try This:
        <h1 style="color:blue;">Hello World!</h1>
        <p style="background-color:pink;">Welcome to my page.</p>
          

🎨 Fun Practice

Let’s try making your own mini webpage! 🌟

πŸš€ Mission: Make a Page About Your Favorite Animal!
            <!DOCTYPE html>
            <html>
              <head>
                <title>My Favorite Animal</title>
              </head>
              <body>
            
                <h1 style="color:blue;">🐢 My Favorite Animal: Dog!</h1>
            
                <p>Dogs are friendly, smart, and love to play!</p>
            
                <img src="dog.png" alt="Cute Dog" width="200">
            
                <p>
                  Learn more about dogs on 
                  <a href="https://en.wikipedia.org/wiki/Dog" target="_blank">Wikipedia</a>.
                </p>
            
                <h2>Why I Love Dogs:</h2>
                <ul>
                  <li>They are loyal 🐾</li>
                  <li>They play fetch 🎾</li>
                  <li>They give cuddles πŸ€—</li>
                </ul>
            
                <button>Pet the Dog! 🐢</button>
            
              </body>
            </html>
              
βœ… What You Just Used:
  • <h1>, <h2> β€” Big and medium headings
  • <p> β€” Paragraph text
  • <img> β€” Image
  • <a> β€” Link to other websites
  • <ul> <li> β€” A list of reasons
  • <button> β€” A clickable button
✨ Challenge:

Try changing the animal! 🐱 πŸ¦„ 🐒 🐧

Change colors, text, and try adding more lists or buttons!

πŸŽ‰ Bonus Idea:

Make a page about your favorite cartoon, fruit, or game!

🌟 Cool Tips & Tricks

Want to make your webpage extra cool? Here are some simple tricks you can try! 😎

🎨 Add Color

Make your text colorful!

            <h1 style="color:blue;">Hello World!</h1>
              
πŸ–ΌοΈ Resize Images

Make images bigger or smaller.

            <img src="cat.png" width="200">
              
πŸ”— Open Links in New Tab

Make a link open in a new window or tab.

            <a href="https://google.com" target="_blank">Visit Google</a>
              
πŸ†• Line Breaks

Want text on a new line? Use:

            Hello!<br>
            Welcome to my website!
              
πŸ…±οΈ Bold & Italic Text

Make text bold or italic.

            <b>I love coding!</b>
            <br>
            <i>HTML is fun!</i>
              
✨ Emoji Power!

Add emojis anywhere in your text. Just copy-paste them!

            <p>My favorite animal is 🐢</p>
              
🎁 Bonus Tip:

Try mixing colors, emojis, and buttons together to make a super fun webpage!

πŸš€ Learning Roadmap

Ready to become an HTML Superhero? πŸ¦Έβ€β™‚οΈπŸ¦Έβ€β™€οΈ Follow these steps to level up your skills!

  • 🌟 Step 1: Learn What is HTML – Understand how webpages are made.
  • 🧱 Step 2: Explore HTML Structure – How to build your webpage like LEGO blocks.
  • 🏷️ Step 3: Master HTML Tags – Text, images, buttons, and links!
  • πŸ”— Step 4: Learn how to create Links & Tables – Connect pages and make info tables.
  • 🎯 Step 5: Do Fun Practice – Build mini projects like "My Favorite Animal" or "My Birthday Page."
  • ✨ Step 6: Learn Cool Tips – Add colors, emojis, buttons, and magic!
  • πŸš€ Step 7: Build Your First Full Webpage – Put everything together!
  • 🌐 Step 8: Share with friends and family – Show off your awesome work!

πŸŽ‰ Keep practicing and soon you'll be building amazing websites like a PRO!