Practice Questions — Introduction to HTML - The Language of the Web
← Back to NotesTopic-Specific Questions
Question 1
Easy
What does the following HTML render as?
<h1>Hello World</h1>h1 is the biggest heading.
A large, bold heading that says Hello World.
Question 2
Easy
What does this HTML render as?
<p>I love cricket.</p>
<p>I also love mathematics.</p>Each
creates a separate paragraph with space between them.
Two paragraphs on separate lines:
I love cricket.
I also love mathematics.
I love cricket.
I also love mathematics.
Question 3
Easy
Fix this broken tag:
<p>This is a paragraph.<p>The closing tag needs a slash.
<p>This is a paragraph.</p>Question 4
Easy
Write HTML for a simple profile card that shows the name 'Aarav Patel' as a big heading and the description 'I love coding' as a paragraph.
Use
for the name and
for the description.
<h1>Aarav Patel</h1>
<p>I love coding</p>Question 5
Easy
What does this render as?
<h1>Main Title</h1>
<h2>Sub Title</h2>
<h3>Section</h3>h1 is biggest, h6 is smallest.
Three headings of decreasing size: a very large 'Main Title', a medium 'Sub Title', and a smaller 'Section'.
Question 6
Easy
Rohan wrote this image tag but the alt text is wrong. Fix it:
<img src="dog.jpg" alt=My best friend>Attribute values with spaces need quotes.
<img src="dog.jpg" alt="My best friend">Question 7
Easy
What does this HTML create?
<a href="https://google.com">Click me</a>A clickable link with the blue underlined text 'Click me' that opens google.com when clicked.
Question 8
Easy
Write HTML to display an unordered list with three items: Apple, Mango, Banana.
Use
- for the list and
- for each item.
<ul>
<li>Apple</li>
<li>Mango</li>
<li>Banana</li>
</ul>Question 9
Easy
Ananya wrote this code but the headline will not show. What is wrong?
<!DOCTYPE html>
<html>
<head>
<h1>Welcome to my page</h1>
</head>
<body>
</body>
</html>Visible content belongs in a specific section.
Move the
<h1> from inside <head> into <body>.Question 10
Easy
What does this render as?
<p>Line one.<br>Line two.</p>is a line break.
One paragraph with two lines:
Line one.
Line two.
Line one.
Line two.
Question 11
Easy
Write a complete HTML page (with DOCTYPE, html, head, body) that shows the heading 'My Hobbies' and a paragraph saying 'I like cricket and painting.'
Remember the standard structure: DOCTYPE, html, head (with title), body (with content).
<!DOCTYPE html>
<html>
<head>
<title>Hobbies</title>
</head>
<body>
<h1>My Hobbies</h1>
<p>I like cricket and painting.</p>
</body>
</html>Question 12
Easy
What does this render?
<ol>
<li>Wake up</li>
<li>Brush teeth</li>
<li>Eat breakfast</li>
</ol>- is an ordered list.
A numbered list:
1. Wake up
2. Brush teeth
3. Eat breakfast
1. Wake up
2. Brush teeth
3. Eat breakfast
Question 13
Medium
Vikram wrote this link but it does not go anywhere when clicked. Fix it:
<a>Visit Wikipedia</a>A link needs a destination.
<a href="https://www.wikipedia.org">Visit Wikipedia</a>Question 14
Medium
What does this HTML produce?
<h1>Recipe</h1>
<p>Ingredients:</p>
<ul>
<li>Flour</li>
<li>Sugar</li>
<li>Milk</li>
</ul>
<hr>
<p>Mix well and bake.</p>Go element by element — heading, paragraph, list, horizontal rule, paragraph.
A heading 'Recipe', then 'Ingredients:', then a bulleted list of Flour, Sugar, Milk, then a horizontal line, then the text 'Mix well and bake.'
Question 15
Medium
Write HTML for an image of a sunset that has the alt text 'Beautiful sunset at the beach' and uses the source 'sunset.jpg'.
<img src="sunset.jpg" alt="Beautiful sunset at the beach">Question 16
Medium
Neha saved a file with her HTML but double-clicking it opens Notepad instead of a browser. What is wrong?
Check the file extension.
The file was probably saved as
.txt instead of .html. Rename the file so it ends with .html (for example page.html).Question 17
Medium
What does this render?
<h2>Contact</h2>
<p>Email me at <a href="mailto:rohan@example.com">rohan@example.com</a></p>The anchor tag is nested inside the paragraph.
A sub-heading 'Contact' followed by 'Email me at rohan@example.com' where the email address is a clickable link.
Question 18
Medium
Write HTML for a page that has the title 'My Dog' (shown on the browser tab), a heading 'Meet Buddy', and a paragraph describing the dog.
Use inside for the tab title and
inside for the visible heading.
<!DOCTYPE html>
<html>
<head>
<title>My Dog</title>
</head>
<body>
<h1>Meet Buddy</h1>
<p>Buddy is a golden retriever who loves playing fetch in the park.</p>
</body>
</html>Question 19
Medium
This list is broken. Fix it:
<ul>
Apple
Mango
Banana
</ul>Each item needs its own tag.
<ul>
<li>Apple</li>
<li>Mango</li>
<li>Banana</li>
</ul>Question 20
Medium
What does this code render?
<h1>Welcome</h1>
<h1>Welcome again</h1>
<h1>Welcome one more time</h1>All three are h1 tags — what does that mean visually?
Three identical large headings stacked on top of each other: 'Welcome', 'Welcome again', 'Welcome one more time'.
Question 21
Medium
Write HTML for a simple profile card of 'Priya Sharma' that includes her name as a heading, her age as a paragraph, and a list of three hobbies: reading, painting, dancing.
Combine heading, paragraph, and unordered list tags.
<h1>Priya Sharma</h1>
<p>Age: 14</p>
<h2>Hobbies</h2>
<ul>
<li>Reading</li>
<li>Painting</li>
<li>Dancing</li>
</ul>Question 22
Hard
What will the browser show for this code?
<p>Hello<br>World<br>From HTML</p>creates line breaks inside the same paragraph.
One paragraph that looks like:
Hello
World
From HTML
Hello
World
From HTML
Question 23
Hard
Vikram wrote this but the browser shows no image. Find all the bugs:
<img scr=cat.jpg>Check the attribute name and the quotes.
<img src="cat.jpg" alt="A cat">Question 24
Hard
Write a complete HTML page for a mini 'About Me' website. It should have a title 'About Aarav', a main heading with the name, a paragraph about you, a sub-heading 'Favourite Subjects', an unordered list of three subjects, and a link to your school's website.
Use DOCTYPE, html, head (with title), and body (with all content).
<!DOCTYPE html>
<html>
<head>
<title>About Aarav</title>
</head>
<body>
<h1>Aarav Gupta</h1>
<p>I am 13 years old and I love building things with HTML.</p>
<h2>Favourite Subjects</h2>
<ul>
<li>Computer Science</li>
<li>Mathematics</li>
<li>Science</li>
</ul>
<p>Visit my school: <a href="https://www.myschool.in">My School</a></p>
</body>
</html>Question 25
Hard
What is wrong with this output prediction: the developer expects 'Hello World' on one line, but it shows on two lines?
<h1>Hello</h1>Worldh1 is a block-level element.
The
<h1> is a block-level element, meaning it takes up the full width and creates a line break after it. So 'World' appears on the next line.Mixed & Application Questions
Question 1
Easy
What does this render?
<h2>About Me</h2>h2 is a sub-heading.
A medium-sized bold heading saying 'About Me'.
Question 2
Easy
Write HTML for a link that opens the Modern Age Coders website.
Use the tag with href.
<a href="https://learn.modernagecoders.com">Modern Age Coders</a>Question 3
Easy
What does this render?
<p>Item 1</p>
<hr>
<p>Item 2</p>is a horizontal rule.
'Item 1', then a horizontal line across the page, then 'Item 2'.
Question 4
Easy
Fix this:
<h1>Hello</h2>Opening and closing tags must match.
<h1>Hello</h1>Question 5
Easy
Write HTML for three paragraphs introducing yourself, your age, and your city.
Use three separate
tags.
<p>My name is Ananya.</p>
<p>I am 12 years old.</p>
<p>I live in Mumbai.</p>Question 6
Medium
What does this render?
<h1>Shop</h1>
<h3>Fruits</h3>
<ul><li>Apple</li><li>Mango</li></ul>HTML ignores whitespace — the list still renders with bullets.
A big heading 'Shop', a smaller heading 'Fruits', then a bulleted list with Apple and Mango.
Question 7
Medium
Write HTML that shows an image named 'logo.png' with alt text 'Company Logo', followed by a heading 'Welcome', followed by a link to 'about.html' with the text 'Learn more'.
Combine img, h1, and a tags.
<img src="logo.png" alt="Company Logo">
<h1>Welcome</h1>
<a href="about.html">Learn more</a>Question 8
Medium
Rohan's page looks wrong. Find the problem:
<!DOCTYPE html>
<html>
<body>
<h1>Hi</h1>
</body>Something is missing at the end.
The closing
</html> tag is missing. Add it after </body>.Question 9
Medium
What does this render?
<ol>
<li>Morning</li>
<li>Afternoon</li>
<li>Evening</li>
<li>Night</li>
</ol>- is an ordered list.
A numbered list:
1. Morning
2. Afternoon
3. Evening
4. Night
1. Morning
2. Afternoon
3. Evening
4. Night
Question 10
Medium
Write HTML for a news article layout: a title, the author's name in a smaller heading, a paragraph of content, and a horizontal line at the bottom.
Use h1 for title, h3 or h4 for author, p for content, and hr for the line.
<h1>Local School Wins Robotics Contest</h1>
<h3>By Priya Sharma</h3>
<p>Students from Delhi Public School won first prize at the national robotics contest held last week.</p>
<hr>Question 11
Medium
Why does this list not have bullets?
<li>One</li>
<li>Two</li>
<li>Three</li>List items must be inside a list container.
<ul>
<li>One</li>
<li>Two</li>
<li>Three</li>
</ul>Question 12
Hard
What does this render?
<ul>
<li>Fruits
<ul>
<li>Apple</li>
<li>Mango</li>
</ul>
</li>
<li>Vegetables</li>
</ul>Lists can be nested inside other lists.
A bulleted list where 'Fruits' has an indented sub-list with Apple and Mango, and then 'Vegetables' as the second main item.
Question 13
Hard
Write a complete HTML page for a restaurant menu: title 'Tasty Bites', heading 'Our Menu', a sub-heading 'Starters' with an unordered list of three starters, a sub-heading 'Main Course' with an ordered list of three main courses, and a horizontal line at the bottom.
Combine everything you know: DOCTYPE, html, head, body, h1, h2, ul, ol, li, hr.
<!DOCTYPE html>
<html>
<head>
<title>Tasty Bites</title>
</head>
<body>
<h1>Our Menu</h1>
<h2>Starters</h2>
<ul>
<li>Paneer Tikka</li>
<li>Veg Spring Rolls</li>
<li>Tomato Soup</li>
</ul>
<h2>Main Course</h2>
<ol>
<li>Butter Chicken</li>
<li>Dal Makhani</li>
<li>Biryani</li>
</ol>
<hr>
</body>
</html>Question 14
Hard
What are the two problems with this link?
<a href=google.com>Click<a>Look at the href value and the closing tag.
<a href="https://google.com">Click</a>Question 15
Hard
Write HTML for a blog post with a heading, an image at the top (with alt text), two paragraphs of content, a sub-heading 'Conclusion', one more paragraph, and a link at the bottom that says 'Read more articles'.
Combine h1, img, p, h2, and a.
<h1>My First Trip to the Hills</h1>
<img src="hills.jpg" alt="Mountains covered in snow">
<p>Last weekend, my family and I went to the hills for a short trip.</p>
<p>The weather was perfect and the views were amazing.</p>
<h2>Conclusion</h2>
<p>It was one of the best trips I have ever had.</p>
<a href="articles.html">Read more articles</a>Multiple Choice Questions
MCQ 1
What does HTML stand for?
Answer: B
B is correct. HTML stands for HyperText Markup Language. 'HyperText' refers to text with clickable links, and 'Markup Language' means we add tags to mark the meaning of content.
B is correct. HTML stands for HyperText Markup Language. 'HyperText' refers to text with clickable links, and 'Markup Language' means we add tags to mark the meaning of content.
MCQ 2
Who invented HTML?
Answer: B
B is correct. Tim Berners-Lee invented HTML in 1991 while working at CERN. He also created the first web browser and web server, which together started the World Wide Web.
B is correct. Tim Berners-Lee invented HTML in 1991 while working at CERN. He also created the first web browser and web server, which together started the World Wide Web.
MCQ 3
Which tag creates the largest heading?
Answer: C
C is correct.
C is correct.
<h1> is the largest heading. Heading tags go from <h1> (biggest) to <h6> (smallest). <heading> is not a valid HTML tag.MCQ 4
Which tag is used for a paragraph?
Answer: C
C is correct. The
C is correct. The
<p> tag creates a paragraph. <para>, <paragraph>, and <text> are not valid HTML tags.MCQ 5
What file extension do HTML files use?
Answer: C
C is correct. HTML files must end with
C is correct. HTML files must end with
.html (or sometimes .htm). This tells the computer to open the file with a web browser, not a text editor.MCQ 6
Which tag creates a line break?
Answer: B
B is correct.
B is correct.
<br> creates a line break. It is a self-closing tag with no content inside. The other options are not valid HTML tags.MCQ 7
What is HTML?
Answer: B
B is correct. HTML is a markup language — it describes the structure of content using tags. It is not a programming language because it cannot make decisions, do math, or loop. CSS and JavaScript add style and logic.
B is correct. HTML is a markup language — it describes the structure of content using tags. It is not a programming language because it cannot make decisions, do math, or loop. CSS and JavaScript add style and logic.
MCQ 8
Which tag creates a clickable link?
Answer: C
C is correct. The
C is correct. The
<a> tag (anchor tag) creates a hyperlink. The href attribute inside it specifies the destination. <link> is a different tag used in the head for linking to CSS files.MCQ 9
Which tag does NOT need a closing tag?
Answer: B
B is correct.
B is correct.
<img> is a self-closing (void) tag — it has no content between opening and closing. Other self-closing tags include <br>, <hr>, and <input>.MCQ 10
Where should the visible content of the page go?
Answer: B
B is correct. All visible content — headings, paragraphs, images, links, lists — goes inside
B is correct. All visible content — headings, paragraphs, images, links, lists — goes inside
<body>. The <head> is for metadata like the title and character encoding.MCQ 11
Which attribute specifies the destination URL of a link?
Answer: C
C is correct. The
C is correct. The
href attribute on an <a> tag holds the URL the link goes to. src is used for images and scripts, not links.MCQ 12
What is an HTML element?
Answer: C
C is correct. An element consists of the opening tag, the content inside, and the closing tag. For example,
C is correct. An element consists of the opening tag, the content inside, and the closing tag. For example,
<p>Hello</p> is one element. Self-closing tags like <img> are also elements, just without inner content.MCQ 13
What is the correct way to add an image?
Answer: C
C is correct. The correct tag is
C is correct. The correct tag is
<img> with src for the source and alt for the alternative text. <image> is not a valid tag, and href is for links, not images.MCQ 14
What does the DOCTYPE declaration do?
Answer: B
B is correct.
B is correct.
<!DOCTYPE html> at the very top tells the browser to render the page using the HTML5 standard. Without it, browsers may fall back to an older rendering mode.MCQ 15
Which tag creates a numbered list?
Answer: C
C is correct.
C is correct.
<ol> creates an ordered (numbered) list. <ul> creates an unordered (bulleted) list. Both contain <li> items.MCQ 16
Which of these is an attribute?
Answer: B
B is correct. An attribute is a name-value pair written inside an opening tag, like
B is correct. An attribute is a name-value pair written inside an opening tag, like
href="page.html". <p> is a tag, 'Hello World' is content, and </p> is a closing tag.MCQ 17
What version of HTML is currently standard?
Answer: C
C is correct. HTML5, released in 2014, is the current standard. HTML5 added native support for audio, video, canvas drawings, and many other features. HTML 6 does not exist yet.
C is correct. HTML5, released in 2014, is the current standard. HTML5 added native support for audio, video, canvas drawings, and many other features. HTML 6 does not exist yet.
MCQ 18
Which of these statements is TRUE about HTML?
Answer: C
C is correct. HTML is very forgiving — if you misspell a tag or forget a closing tag, the browser usually tries to fix it. This makes HTML great for learning. HTML needs no compiler (A), is not strictly case-sensitive for tags (B), and cannot do math (D).
C is correct. HTML is very forgiving — if you misspell a tag or forget a closing tag, the browser usually tries to fix it. This makes HTML great for learning. HTML needs no compiler (A), is not strictly case-sensitive for tags (B), and cannot do math (D).
MCQ 19
What is the DOM?
Answer: C
C is correct. DOM stands for Document Object Model. It is the tree-like structure the browser builds in memory from your HTML. JavaScript can read and change the DOM to make pages interactive.
C is correct. DOM stands for Document Object Model. It is the tree-like structure the browser builds in memory from your HTML. JavaScript can read and change the DOM to make pages interactive.
MCQ 20
In which year was HTML invented?
Answer: B
B is correct. HTML was invented by Tim Berners-Lee in 1991 at CERN. 2014 (D) is when HTML5 was officially standardised, but HTML itself is much older.
B is correct. HTML was invented by Tim Berners-Lee in 1991 at CERN. 2014 (D) is when HTML5 was officially standardised, but HTML itself is much older.
Coding Challenges
Challenge 1: My First Profile Card
EasyMust be a complete HTML document with DOCTYPE, html, head, and body. Use h1, p, ul, and li tags.
<!DOCTYPE html>
<html>
<head>
<title>My Profile</title>
</head>
<body>
<h1>Aarav</h1>
<p>I am learning HTML</p>
<ul>
<li>Cricket</li>
<li>Painting</li>
<li>Reading</li>
</ul>
</body>
</html>Challenge 2: Simple Recipe Page
EasyUse h1, h2, ul, ol, and li tags.
<!DOCTYPE html>
<html>
<head>
<title>Chocolate Milkshake</title>
</head>
<body>
<h1>Chocolate Milkshake</h1>
<h2>Ingredients</h2>
<ul>
<li>2 glasses of milk</li>
<li>3 spoons of chocolate powder</li>
<li>1 scoop of vanilla ice cream</li>
</ul>
<h2>Steps</h2>
<ol>
<li>Pour the milk into a blender</li>
<li>Add the chocolate powder and ice cream</li>
<li>Blend for 30 seconds and serve cold</li>
</ol>
</body>
</html>Challenge 3: My Favourite Books Page
MediumUse h1 for the main heading, h2 for each book title, and p for author and description.
<!DOCTYPE html>
<html>
<head>
<title>My Books</title>
</head>
<body>
<h1>My Favourite Books</h1>
<h2>Harry Potter</h2>
<p>Author: J.K. Rowling</p>
<p>A young wizard discovers his magical powers and goes to a wizard school.</p>
<h2>The Jungle Book</h2>
<p>Author: Rudyard Kipling</p>
<p>A boy raised by wolves has amazing adventures in an Indian jungle.</p>
<h2>Panchatantra</h2>
<p>Author: Vishnu Sharma</p>
<p>A collection of wise animal stories that teach life lessons.</p>
</body>
</html>Challenge 4: Navigation With Links
MediumUse h1 for the heading and <a> with href for links. Each link should be wrapped in its own <p>.
<!DOCTYPE html>
<html>
<head>
<title>My Links</title>
</head>
<body>
<h1>Welcome</h1>
<p><a href="https://www.google.com">Visit Google</a></p>
<p><a href="https://www.wikipedia.org">Visit Wikipedia</a></p>
<p><a href="https://learn.modernagecoders.com">Modern Age Coders</a></p>
</body>
</html>Challenge 5: Image Gallery Layout
MediumUse h1, h2, img (with src and alt), and p tags.
<!DOCTYPE html>
<html>
<head>
<title>My Gallery</title>
</head>
<body>
<h1>My Gallery</h1>
<h2>Sunset at the Beach</h2>
<img src="https://via.placeholder.com/400x250" alt="Orange sunset over the ocean">
<p>This photo was taken during our family trip to Goa last summer.</p>
<h2>Snowy Mountains</h2>
<img src="https://via.placeholder.com/400x250" alt="Mountains covered in snow">
<p>We visited the Himalayas in December and saw real snow for the first time.</p>
<h2>City Skyline</h2>
<img src="https://via.placeholder.com/400x250" alt="City buildings at night">
<p>The beautiful night lights of Mumbai from the top of a tall building.</p>
</body>
</html>Challenge 6: Mini Blog Post
HardUse h1, h2, p, ol, li, hr, and a tags. Everything should be inside body.
<!DOCTYPE html>
<html>
<head>
<title>My First Blog Post</title>
</head>
<body>
<h1>My First Week Learning HTML</h1>
<p>By Priya Sharma</p>
<p>Last Monday I started learning HTML at Modern Age Coders. I was nervous at first because I had never written any code before.</p>
<p>By the end of the week, I was building my own web pages and sharing them with my family. It was the best week of my life so far.</p>
<h2>What I Learned</h2>
<ol>
<li>How to create a complete HTML page from scratch</li>
<li>The difference between block and inline elements</li>
<li>How to use images, lists, and links</li>
</ol>
<hr>
<a href="index.html">Back to Home</a>
</body>
</html>Challenge 7: School Event Invitation
HardUse DOCTYPE, html, head, body, h1, h2, p, ol, ul, li, and a.
<!DOCTYPE html>
<html>
<head>
<title>Annual Science Fair</title>
</head>
<body>
<h1>Annual Science Fair 2026</h1>
<p>Date: 15 August 2026</p>
<p>Venue: School Auditorium, Main Building</p>
<h2>Schedule</h2>
<ol>
<li>9:00 AM - Opening Ceremony</li>
<li>10:00 AM - Student Project Exhibitions</li>
<li>2:00 PM - Prize Distribution</li>
</ol>
<h2>Special Guests</h2>
<ul>
<li>Dr. Ananya Rao - Senior Scientist</li>
<li>Mr. Rohan Mehta - Robotics Engineer</li>
<li>Ms. Kavya Iyer - Science Teacher of the Year</li>
</ul>
<a href="register.html">Register Here</a>
</body>
</html>Challenge 8: Complete Portfolio Home Page
HardMust include DOCTYPE, html, head (with title), body, h1, h2, p, img, ol, li, a (with mailto:), hr.
<!DOCTYPE html>
<html>
<head>
<title>My Portfolio</title>
</head>
<body>
<h1>Neha Verma</h1>
<p>Hi, I am Neha. I am a 14-year-old student from Bangalore who loves building things with HTML and CSS.</p>
<img src="https://via.placeholder.com/200x200" alt="Photo of Neha">
<h2>Projects</h2>
<ol>
<li>Personal Blog Website</li>
<li>Recipe Collection Page</li>
<li>Favourite Books Gallery</li>
</ol>
<h2>Contact</h2>
<p>You can email me at <a href="mailto:neha@example.com">neha@example.com</a></p>
<p>I would love to hear from you if you have any ideas or feedback.</p>
<hr>
<p>Made with HTML by Neha Verma</p>
</body>
</html>Need to Review the Concepts?
Go back to the detailed notes for this chapter.
Read Chapter NotesWant to learn web development with a live mentor?
Explore our Frontend Masterclass