Kit Library / Computer Science / Web Development

📚 Chapter Learning Kit

HTML Basics

English 6 topics 245 leveled MCQs 83 flashcards 12 games Free

Shared by a Veda teacher · Generated with Veda AI

Veda Bites

The whole idea, one bite at a time

Veda Bites are swipeable micro-lessons — each one teaches exactly one idea. The bites below come from this kit — swipe through them in the app.

💡 Key Idea

HTML Is a Markup Language, Not a Programming Language

It structures content — it doesn't compute.

HTML uses tags to describe the meaning and structure of content on a web page. It does not have logic, loops, or variables like programming languages.

↳ HTML is about labeling content (headings, paragraphs, links) so browsers display it correctly — no logic involved.

📖 Definition

What Does 'HyperText Markup Language' Mean?

Every word in the name matters.

↳ HTML = linked, tagged, structured documents — the foundation of the World Wide Web.

⭐ Important Fact

HTML Is the Standard — Every Browser Follows It

One language, billions of pages.

HTML is the official standard for web documents, maintained by the World Wide Web Consortium (W3C). Every browser (Chrome, Firefox, Safari) interprets HTML the same way.

↳ Because HTML is a universal standard, a page written in HTML works on any modern browser.

✏️ Example

A Simple HTML Page in Action

See how tags create structure.

↳ HTML tags wrap content to tell the browser what role each piece plays — heading, paragraph, link, etc.

⚠️ Common Mistake

Confusing HTML Tags With Visual Styling

Don't use `<h1>` just to make text big.

↳ HTML is about meaning (semantics), not appearance. Use CSS for styling, HTML for structure.

🌍 Real World

Every Website You Visit Uses HTML

Right-click → 'View Page Source' — that's HTML.

From Google's homepage to Wikipedia articles to your school's portal — every web page is built with HTML. It's the skeleton that holds text, images, videos, and links together.

↳ HTML is the invisible scaffolding behind every web experience — understanding it unlocks how the web works.

🎯 Exam Tip

Remember: HTML Describes Structure, Not Style

Exam trick — spot the markup language.

In exams, you may be asked to identify HTML's role. The key phrase: 'standard markup language for documents designed to be displayed in a web browser.'

↳ If a question asks about 'markup language' or 'web page structure,' the answer is HTML.

💡 Key Idea

The Four Pillars of Every HTML Page

Every web page starts with this skeleton.

An HTML document is built from four required sections that always appear in this exact order:

↳ The four-part skeleton (DOCTYPE, html, head, body) is the unchanging foundation of every HTML document.

📖 Definition

Key Terms: DOCTYPE, html, head, body

Know these four terms by heart.

↳ These four elements form the mandatory outer structure of any valid HTML document.

💻 Code Example

Minimal HTML Document in Action

See the skeleton come to life.

Notice the indentation — it's not required by HTML but makes the structure readable for developers.

↳ The `<title>` in `<head>` sets the browser tab label; everything in `<body>` is what the user actually sees.

⚠️ Common Mistake

Forgetting the DOCTYPE Declaration

One missing line breaks the rules.

↳ The DOCTYPE is not optional; it switches the browser into standards mode for consistent rendering.

🌍 Real World

Why the Head-Body Split Matters

Not everything goes on screen.

In a real website, the `<head>` might contain:

↳ Separating metadata (head) from visible content (body) keeps HTML clean, accessible, and SEO-friendly.

🎯 Exam Tip

Exam-Ready: Order of Elements

Get the sequence right every time.

In exams, you may be asked to identify the correct order of HTML document sections. Remember this sequence:

↳ The DOCTYPE comes first, then html, then head, then body — always in that exact order.

📖 Definition

What Is an HTML Tag?

The basic unit of every web page.

Most HTML elements require both an opening and a closing tag to work correctly.

↳ An HTML tag is always written inside angle brackets; closing tags include a forward slash before the tag name.

💡 Key Idea

Paired Tags: The Standard Pattern

Open it, close it — every time.

The fundamental pattern in HTML is a paired tag: an opening tag, some content, then a closing tag.

↳ Paired tags are the default in HTML — always remember the closing tag with its forward slash.

⚠️ Common Mistake

Forgetting the Closing Tag

One missing slash breaks the page.

↳ A missing closing tag is the most common beginner HTML mistake — check for the forward slash every time.

✏️ Example

Real HTML Tag in Action

See how a heading actually works.

↳ Every visible element on a web page starts with a paired tag — headings, paragraphs, links, and images all follow this rule.

🧠 Memory Trick

Remember the Forward Slash

Slash means 'stop' in HTML.

Think of the forward slash `/` as a stop sign — it tells the browser to stop the element.

↳ The forward slash in a closing tag signals the end of an element — like a stop sign for the browser.

💡 Key Idea

Headings Show Importance, Not Size

Bigger number ≠ bigger importance.

HTML headings use a hierarchy from 1 to 6, where <h1> is the most important (like a book title) and <h6> is the least important (like a minor sub-note). The visual size is just a default — the real meaning is the structural importance.

↳ Always use headings in order — never skip levels just to get a smaller font.

📖 Definition

What Are <h1> to <h6>?

Six tags, one clear hierarchy.

↳ Think of headings like an outline — <h1> is the top, <h6> is the deepest detail.

📖 Definition

The <p> Tag: Paragraphs

Every block of text starts here.

↳ Use <p> for any standalone block of text, not for single lines or headings.

⚠️ Common Mistake

Don't Use Headings Just for Bold Text

Style is not structure.

↳ Headings are for structure, not styling. Use CSS for visual changes.

✏️ Example

A Simple Page with Headings and Paragraphs

See how it all fits together.

↳ Always start with <h1> for the page title, then use <h2> for sections, and wrap all body text in <p>.

🎯 Exam Tip

Exam Trick: Heading Level Order

Don't skip levels on tests.

Many exams ask you to identify the correct heading hierarchy. Remember: you should never skip a level (e.g., going from <h2> directly to <h4>).

↳ Headings must follow a logical, sequential order — no skipping levels.

🌍 Real World

Why Headings Matter for Accessibility

Screen readers rely on your structure.

Visually impaired users navigate web pages using screen readers that announce heading levels. A well-structured heading hierarchy lets them jump directly to the section they need.

↳ Proper heading order isn't just good practice — it's essential for inclusive web design.

🧠 Memory Trick

Remember: 1 is King, 6 is Peasant

Think royalty for heading levels.

Imagine a kingdom: <h1> is the king (most important), <h2> are the princes (next), and <h6> is the peasant (least important). The higher the number, the lower the rank.

↳ Lower number = higher importance. <h1> is always the top level.

📖 Definition

What Is an Anchor Tag?

The building block of the web.

↳ The <a> tag with an href attribute is how you make clickable links in HTML.

💡 Key Idea

Anatomy of a Link

Two parts make every link work.

Every anchor link has two essential components: the destination (href) and the clickable text (content between tags).

↳ Without both href and link text, the link is incomplete or invisible.

✏️ Example

A Simple Link in Action

See how a real link looks.

The browser displays the text "Visit Example" and navigates to `https://example.com` when clicked.

↳ The href value is the destination; the tag content is what the user sees and clicks.

⚠️ Common Mistake

Missing href or Missing Text

Two common link-breaking mistakes.

↳ A valid link must have both an href attribute and content between the tags.

Smart notes

What you'll study, topic by topic

1

What is HTML?

12 min

HTML (HyperText Markup Language) is the standard language for creating web pages. It uses tags to structure content semantically, defining headings, paragraphs, links, and more — forming the backbone of every website.

  • HTML stands for HyperText Markup Language — it is a markup language, not a programming language.
  • HTML uses tags (e.g., ``, ``) to define the structure and meaning of web content.
  • Most tags come in pairs: an opening tag and a closing tag with a forward slash.

Full explanation, worked examples & memory tricks in the app

2

Basic Structure of an HTML Document

10 min

Every HTML document follows a fixed skeleton: the DOCTYPE declaration, the html element, the head (metadata, title, links), and the body (visible content). Understanding this structure is the first step to building any w…

  • The `` declaration must be the very first line in every HTML5 document to prevent quirks mode.
  • The `` element is the root container that wraps all other HTML content.
  • The `` section holds metadata (title, character encoding, CSS links) that is not directly visible on the page.

Full explanation, worked examples & memory tricks in the app

3

HTML Tags: Structure and Syntax

10 min

HTML tags are the building blocks of web pages. Most tags come in pairs — an opening tag and a closing tag — with the closing tag containing a forward slash before the tag name. Understanding this simple syntax is the fo…

  • HTML tags are keywords surrounded by angle brackets, e.g., ``.
  • Most tags come in pairs: an opening tag and a closing tag with a forward slash.
  • An HTML element consists of an opening tag, content, and a closing tag.

Full explanation, worked examples & memory tricks in the app

4

HTML Headings and Paragraphs

10 min

HTML uses heading tags to to define headings by importance, and the tag to define paragraphs. These are the foundational building blocks for structuring text content on web pages.

  • HTML headings use `` (most important) to `` (least important) to define a hierarchy of titles and subtitles.
  • The `` tag defines a paragraph, a block of text that develops a single idea.
  • Browsers automatically add space before and after `` elements for readability.

Full explanation, worked examples & memory tricks in the app

5

HTML Links: The Anchor Tag

10 min

HTML links are created using the (anchor) tag. The href attribute specifies the destination URL. This topic covers the essential syntax and usage of anchor tags for creating hyperlinks.

  • The `` (anchor) tag creates hyperlinks in HTML.
  • The `href` attribute specifies the destination URL.
  • Link text is the visible, clickable content between `` and ``.

Full explanation, worked examples & memory tricks in the app

6

HTML Forms: Structure and Input Elements

12 min

HTML forms collect user input using the element and various types like text, password, email, and submit. This topic covers the basic structure and attributes needed to create functional forms.

  • Forms are created with the `` element, which groups input fields.
  • The `` tag is the primary way to collect user data.
  • The `type` attribute of `` determines the kind of input (text, password, email, submit, etc.).

Full explanation, worked examples & memory tricks in the app

Leveled MCQ practice

Try the smart MCQs from this kit

120 of this kit's 245 questions, laddered from warm-up to topper-level, each with its answer and the reasoning. The rest are in the app.

Warm-up · 75 questions

Q1. What is the very first line in every HTML5 document?

Beginner
A `<body>`
B `<html>`
C `<head>`
D `<!DOCTYPE html>`

Answers and explanations are in the Veda app.

Q2. Which element is the root container that wraps all other HTML content?

Beginner
A `<html>`
B `<head>`
C `<body>`
D `<!DOCTYPE html>`

Answers and explanations are in the Veda app.

Q3. Which of the following is NOT typically placed inside the `<head>` section?

Beginner
A `<link rel="stylesheet" href="style.css">`
B `<title>`
C `<h1>`
D `<meta charset="UTF-8">`

Answers and explanations are in the Veda app.

Q4. What is the main consequence of forgetting the `<!DOCTYPE html>` declaration?

Beginner
A The page will not load at all.
B The page will load faster.
C The browser may render the page in quirks mode, breaking layouts.
D The `<title>` tag will be ignored.

Answers and explanations are in the Veda app.

Q5. Why are CSS stylesheets linked inside the `<head>` rather than the `<body>`?

Beginner
A To prevent a flash of unstyled content (FOUC).
B To make the HTML file smaller.
C To allow the browser to ignore CSS.
D To improve JavaScript performance.

Answers and explanations are in the Veda app.

Q6. A developer places a `<script>` tag inside the `<head>` that loads a large JavaScript file. What is the most likely negative effect?

Beginner
A The page will render faster.
B The JavaScript will not execute.
C The CSS will stop working.
D The page content may be delayed from rendering while the script loads.

Answers and explanations are in the Veda app.

Q7. Which attribute on the `<html>` tag improves accessibility by specifying the language of the page?

Beginner
A `class`
B `style`
C `lang`
D `id`

Answers and explanations are in the Veda app.

Q8. A student writes an HTML file with the following structure: `<!DOCTYPE html><html><body><head><title>Test</title></head></body></html>`. What is the main structural error?

Beginner
A The `<head>` is placed inside the `<body>`, which is incorrect.
B The `<title>` tag is missing.
C The `<html>` tag is missing the `lang` attribute.
D The `<!DOCTYPE html>` is missing.

Answers and explanations are in the Veda app.

Q9. The `<!DOCTYPE html>` declaration is an HTML tag.

Beginner
A True
B False

Answers and explanations are in the Veda app.

Q10. The `<head>` and `<body>` elements are siblings, both nested directly inside the `<html>` element.

Beginner
A True
B False

Answers and explanations are in the Veda app.

Q11. Placing `<link>` tags for CSS in the `<body>` is a best practice for performance.

Beginner
A True
B False

Answers and explanations are in the Veda app.

Q12. A valid HTML document can have multiple `<body>` elements.

Beginner
A True
B False

Answers and explanations are in the Veda app.

Q13. The ___ declaration must be the very first line in every HTML5 document to prevent quirks mode.

Beginner

Answers and explanations are in the Veda app.

Q14. The ___ element is the root container that wraps all other HTML content.

Beginner

Answers and explanations are in the Veda app.

Q15. The ___ section contains metadata such as the title and links to CSS files.

Beginner

Answers and explanations are in the Veda app.

Q16. The ___ attribute on the `<html>` tag specifies the language of the page, improving accessibility.

Beginner

Answers and explanations are in the Veda app.

Q17. What is the purpose of the `<!DOCTYPE html>` declaration?

Beginner

Answers and explanations are in the Veda app.

Q18. Name the four main structural components of an HTML document in order.

Beginner

Answers and explanations are in the Veda app.

Q19. What is the role of the `<html>` element?

Beginner

Answers and explanations are in the Veda app.

Q20. What type of information is stored in the `<head>` section?

Beginner

Answers and explanations are in the Veda app.

Q21. What is the function of the `<body>` element?

Beginner

Answers and explanations are in the Veda app.

Q22. What does the `<meta charset="UTF-8">` tag do?

Beginner

Answers and explanations are in the Veda app.

Q23. How many `<html>`, `<head>`, and `<body>` elements should a valid HTML document have?

Beginner

Answers and explanations are in the Veda app.

Q24. What is the relationship between the `<head>` and `<body>` elements?

Beginner

Answers and explanations are in the Veda app.

Q25. Which of the following is the correct way to write a closing tag for a paragraph?

Beginner
A `<p />`
B `</p>`
C `<\p>`
D `<p>`

Answers and explanations are in the Veda app.

Q26. What is the main difference between an opening tag and a closing tag?

Beginner
A The closing tag has an asterisk after the tag name.
B The closing tag is written in uppercase.
C The closing tag has a forward slash before the tag name.
D The closing tag has an exclamation mark.

Answers and explanations are in the Veda app.

Q27. Which of the following is a self-closing tag?

Beginner
A `<h1>`
B `<br>`
C `<li>`
D `<p>`

Answers and explanations are in the Veda app.

Q28. What does semantic HTML primarily improve?

Beginner
A Font styling
B Page loading speed
C Accessibility, SEO, and code readability
D Image quality

Answers and explanations are in the Veda app.

Q29. What is the correct nesting order for an unordered list with two items?

Beginner
A `<ul><li>Item 1</li><li>Item 2</li></ul>`
B `<li><ul>Item 1</ul></li>`
C `<li><ul>Item 1</li><li>Item 2</li></ul>`
D `<ul><li>Item 1<li>Item 2</ul>`

Answers and explanations are in the Veda app.

Q30. Which tag should you use to mark up a navigation menu for better accessibility?

Beginner
A `<header>`
B `<nav>`
C `<span>`
D `<div>`

Answers and explanations are in the Veda app.

Q31. What happens if you write `<p>Hello` without a closing tag?

Beginner
A The browser shows an error and stops rendering.
B The browser treats everything after as part of that paragraph until it finds a closing tag or the end of the document.
C The browser ignores the tag and displays plain text.
D The browser automatically adds a closing tag at the end of the line.

Answers and explanations are in the Veda app.

Q32. Why is using `<strong>` preferred over `<b>` in modern HTML?

Beginner
A `<strong>` is faster to render.
B `<strong>` has semantic meaning (importance), while `<b>` is purely stylistic.
C `<strong>` automatically adds a line break.
D `<strong>` works in all browsers, but `<b>` does not.

Answers and explanations are in the Veda app.

Q33. All HTML tags require a closing tag.

Beginner
A True
B False

Answers and explanations are in the Veda app.

Q34. HTML tag names are case-insensitive, but lowercase is the convention.

Beginner
A True
B False

Answers and explanations are in the Veda app.

Q35. Using semantic HTML tags can improve a website's search engine ranking.

Beginner
A True
B False

Answers and explanations are in the Veda app.

Q36. The `<img>` tag requires a closing `</img>` tag.

Beginner
A True
B False

Answers and explanations are in the Veda app.

Q37. An HTML ___ consists of an opening tag, content, and a closing tag.

Beginner

Answers and explanations are in the Veda app.

Q38. The ___ tag is used to create a hyperlink to another webpage.

Beginner

Answers and explanations are in the Veda app.

Q39. Placing one HTML element inside another is called ___.

Beginner

Answers and explanations are in the Veda app.

Q40. The `<h1>` to `<h6>` tags define headings with ___ importance as the number increases.

Beginner

Answers and explanations are in the Veda app.

Q41. What is an HTML tag?

Beginner

Answers and explanations are in the Veda app.

Q42. What is the difference between an opening tag and a closing tag?

Beginner

Answers and explanations are in the Veda app.

Q43. What is an HTML element?

Beginner

Answers and explanations are in the Veda app.

Q44. What is a self-closing tag? Give two examples.

Beginner

Answers and explanations are in the Veda app.

Q45. What does the `<p>` tag do?

Beginner

Answers and explanations are in the Veda app.

Q46. What do the `<h1>` to `<h6>` tags represent?

Beginner

Answers and explanations are in the Veda app.

Q47. What is the purpose of the `<a>` tag?

Beginner

Answers and explanations are in the Veda app.

Q48. What is the purpose of the `<img>` tag?

Beginner

Answers and explanations are in the Veda app.

Q49. What do `<ul>` and `<ol>` tags create?

Beginner

Answers and explanations are in the Veda app.

Q50. What is the convention for writing tag names in HTML?

Beginner

Answers and explanations are in the Veda app.

Q51. What does HTML stand for?

Beginner
A Home Tool Markup Language
B High Tech Modern Language
C HyperTransfer Markup Language
D HyperText Markup Language

Answers and explanations are in the Veda app.

Q52. Which of the following is a self-closing HTML tag?

Beginner
A `<h1>`
B `<p>`
C `<div>`
D `<img>`

Answers and explanations are in the Veda app.

Q53. Why is HTML not considered a programming language?

Beginner
A It cannot be used to create web pages.
B It requires a compiler to run.
C It does not support variables, loops, or conditional logic.
D It is only used for styling.

Answers and explanations are in the Veda app.

Q54. What is the purpose of the `alt` attribute on an `<img>` tag?

Beginner
A To link the image to another page
B To add a border to the image
C To specify the image height
D To provide alternative text for accessibility and SEO

Answers and explanations are in the Veda app.

Q55. Which HTML element wraps the entire document?

Beginner
A `<document>`
B `<body>`
C `<html>`
D `<head>`

Answers and explanations are in the Veda app.

Q56. What is semantic HTML?

Beginner
A Using HTML tags that convey the meaning of content
B Using HTML tags that only affect appearance
C Using HTML tags that are self-closing
D Using HTML tags that contain JavaScript

Answers and explanations are in the Veda app.

Q57. Which of the following is a valid HTML element with an attribute?

Beginner
A `<img src='photo.jpg'>`
B `<img source='photo.jpg'>`
C `<img href='photo.jpg'>`
D `<image src='photo.jpg'>`

Answers and explanations are in the Veda app.

Q58. What is the main advantage of separating HTML structure from CSS presentation?

Beginner
A It makes HTML a programming language.
B It allows the same HTML to be styled differently for different devices.
C It eliminates the need for JavaScript.
D It makes the HTML file larger.

Answers and explanations are in the Veda app.

Q59. HTML is a programming language that can perform calculations.

Beginner
A True
B False

Answers and explanations are in the Veda app.

Q60. The `<head>` element contains the visible content of a web page.

Beginner
A True
B False

Answers and explanations are in the Veda app.

Q61. Using semantic HTML tags can improve a website's search engine ranking.

Beginner
A True
B False

Answers and explanations are in the Veda app.

Q62. The `<br>` tag requires a closing tag like `</br>`.

Beginner
A True
B False

Answers and explanations are in the Veda app.

Q63. HTML uses ___ to annotate text and define the structure of a web page.

Beginner

Answers and explanations are in the Veda app.

Q64. The ___ attribute on an `<img>` tag provides a text description for accessibility and SEO.

Beginner

Answers and explanations are in the Veda app.

Q65. The hierarchical structure of an HTML document is called the ___.

Beginner

Answers and explanations are in the Veda app.

Q66. Modern best practice separates HTML for structure and ___ for presentation.

Beginner

Answers and explanations are in the Veda app.

Q67. What does HTML stand for?

Beginner

Answers and explanations are in the Veda app.

Q68. Is HTML a programming language? Explain briefly.

Beginner

Answers and explanations are in the Veda app.

Q69. What is the difference between an opening tag and a closing tag?

Beginner

Answers and explanations are in the Veda app.

Q70. Give two examples of self-closing HTML tags.

Beginner

Answers and explanations are in the Veda app.

Q71. What is the purpose of the `alt` attribute on an `<img>` tag?

Beginner

Answers and explanations are in the Veda app.

Q72. What are the two main sections inside an `<html>` element?

Beginner

Answers and explanations are in the Veda app.

Q73. What does the `<a>` tag do?

Beginner

Answers and explanations are in the Veda app.

Q74. What is the purpose of the `<head>` element?

Beginner

Answers and explanations are in the Veda app.

Q75. What does the term 'HyperText' in HTML refer to?

Beginner

Answers and explanations are in the Veda app.

Building up · 33 questions

Q76. Why is the `<title>` tag important for SEO?

Intermediate

Answers and explanations are in the Veda app.

Q77. Where should CSS stylesheets be linked in an HTML document and why?

Intermediate

Answers and explanations are in the Veda app.

Q78. Why are `<script>` tags often placed at the end of the `<body>`?

Intermediate

Answers and explanations are in the Veda app.

Q79. What is quirks mode and what causes it?

Intermediate

Answers and explanations are in the Veda app.

Q80. What does the `lang` attribute on the `<html>` tag do?

Intermediate

Answers and explanations are in the Veda app.

Q81. What happens if you place `<title>` or `<link>` tags inside the `<body>`?

Intermediate

Answers and explanations are in the Veda app.

Q82. In what order does a browser process an HTML document?

Intermediate

Answers and explanations are in the Veda app.

Q83. A developer writes the following HTML snippet: ```html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>My Page</title> </head> <body> <h1>Welcome</h1> <p>This is a paragraph.</p> </body> </html> ``` If the developer removes the `<!DOCTYPE html>` declaration, what is the most likely consequence?

Intermediate
A The `<title>` tag will no longer appear on the browser tab.
B The `lang` attribute will become invalid.
C The browser may enter quirks mode, causing unpredictable CSS rendering.
D The page will not load at all.

Answers and explanations are in the Veda app.

Q84. Consider the following HTML document structure: ```html <!DOCTYPE html> <html> <body> <head> <title>Test</title> </head> <p>Content</p> </body> </html> ``` What is the primary structural error in this document?

Intermediate
A The `<head>` element is incorrectly placed inside the `<body>` element.
B The `<p>` tag should be inside a `<div>` element.
C The `<title>` tag is missing a closing slash.
D The `lang` attribute is missing from the `<html>` tag.

Answers and explanations are in the Veda app.

Q85. A developer wants to improve the performance of a webpage that includes a large JavaScript file. Where should the `<script>` tag be placed, and why?

Intermediate
A Immediately after the `<!DOCTYPE html>` declaration, to ensure the script runs first.
B Inside the `<html>` tag but outside `<head>` and `<body>`, to avoid blocking rendering.
C Inside the `<head>` section, because JavaScript should load before the page content.
D At the end of the `<body>` section, so the page content renders before the script downloads and executes.

Answers and explanations are in the Veda app.

Q86. Which of the following statements best explains the relationship between the `<head>` and `<body>` elements in a valid HTML5 document?

Intermediate
A The `<body>` element is a child of the `<head>` element.
B The `<head>` element is a child of the `<body>` element.
C The `<head>` and `<body>` elements are siblings, both nested directly inside the `<html>` element.
D The `<head>` element comes after the `<body>` element in the document order.

Answers and explanations are in the Veda app.

Q87. A developer notices that their webpage displays a flash of unstyled content (FOUC) when loading. Which of the following is the most likely cause related to document structure?

Intermediate
A The `<title>` tag is placed inside the `<body>` section.
B The `<link>` tag for the CSS stylesheet is placed inside the `<body>` section instead of the `<head>`.
C The `<!DOCTYPE html>` declaration is missing.
D The `lang` attribute on the `<html>` tag is set to an incorrect value.

Answers and explanations are in the Veda app.

Q88. What is nesting in HTML?

Intermediate

Answers and explanations are in the Veda app.

Q89. What is semantic HTML?

Intermediate

Answers and explanations are in the Veda app.

Q90. Why is semantic HTML important for accessibility?

Intermediate

Answers and explanations are in the Veda app.

Q91. What happens if you forget a closing tag in HTML?

Intermediate

Answers and explanations are in the Veda app.

Q92. What is the tree structure of HTML elements?

Intermediate

Answers and explanations are in the Veda app.

Q93. Consider the following HTML snippet: ```html <article> <h2>Title</h2> <p>Content <strong>important</strong> text.</p> </article> ``` Which statement best explains the relationship between the `<strong>` element and the `<p>` element?

Intermediate
A The `<strong>` element is a descendant of the `<article>` element but not of the `<p>` element.
B The `<strong>` element is a child of the `<p>` element, and the `<p>` element is a child of the `<article>` element.
C The `<strong>` element is a parent of the `<p>` element because it contains the text 'important'.
D The `<strong>` element is a sibling of the `<p>` element because they are at the same nesting level.

Answers and explanations are in the Veda app.

Q94. Which of the following best explains why using `<nav>` for a navigation menu is preferred over using a generic `<div>` with a class like `class="nav"`?

Intermediate
A The `<nav>` tag automatically applies CSS styles that make the menu look better than a `<div>`.
B The `<nav>` tag is required for the menu to be clickable, while a `<div>` cannot contain links.
C The `<nav>` tag is a self-closing tag, so it reduces the amount of code needed.
D The `<nav>` tag provides semantic meaning that helps screen readers identify the navigation region, improving accessibility.

Answers and explanations are in the Veda app.

Q95. An HTML document contains the following code: ```html <p>First paragraph <p>Second paragraph</p> ``` What is the most likely outcome when a browser renders this code?

Intermediate
A The browser will treat the text 'First paragraph' as a paragraph, and then treat 'Second paragraph' as a separate paragraph, but the first paragraph may incorrectly include subsequent content.
B The browser will display an error because the first `<p>` tag is missing its closing tag.
C The browser will ignore the missing closing tag and display both lines as a single paragraph.
D The browser will automatically close the first `<p>` tag before the second `<p>` tag, so both paragraphs display correctly.

Answers and explanations are in the Veda app.

Q96. Given the following HTML: ```html <ul> <li>Apples</li> <li>Bananas</li> </ul> ``` If a developer wants to add a third item 'Cherries' after 'Bananas', which of the following correctly demonstrates the proper nesting and tag usage?

Intermediate
A ```html <ul> <li>Apples</li> <li>Bananas</li> <li>Cherries</li> </li> ```
B ```html <ul> <li>Apples</li> <li>Bananas</li> <li>Cherries</li> </ul> ``` (Note: This is identical to the first option, but with an extra space before `<ul>`)
C ```html <ul> <li>Apples</li> <li>Bananas</li> <li>Cherries</li> </ul> ```
D ```html <ul> <li>Apples</li> <li>Bananas</li> <li>Cherries</ul> ```

Answers and explanations are in the Veda app.

Q97. Which of the following statements correctly compares the `<b>` tag and the `<strong>` tag in modern HTML?

Intermediate
A Both tags are identical in meaning and should be used interchangeably.
B The `<strong>` tag conveys semantic importance, whereas `<b>` is a presentational tag with no semantic meaning.
C The `<b>` tag is semantic and indicates importance, while `<strong>` is purely presentational.
D The `<b>` tag is a self-closing tag, while `<strong>` requires a closing tag.

Answers and explanations are in the Veda app.

Q98. What is the Document Object Model (DOM)?

Intermediate

Answers and explanations are in the Veda app.

Q99. What is semantic HTML?

Intermediate

Answers and explanations are in the Veda app.

Q100. Why should you avoid using `<font>` or `<center>` tags in modern HTML?

Intermediate

Answers and explanations are in the Veda app.

Q101. How does HTML help with web accessibility?

Intermediate

Answers and explanations are in the Veda app.

Q102. What is the difference between HTML and CSS?

Intermediate

Answers and explanations are in the Veda app.

Q103. Name three places where HTML is used besides web pages.

Intermediate

Answers and explanations are in the Veda app.

Q104. Given the following HTML snippet: ```html <ul> <li>Item A</li> <li>Item B</li> </ul> ``` Which statement best describes the relationship between the `<ul>` and `<li>` elements?

Intermediate
A The `<ul>` and `<li>` elements are both self-closing tags.
B The `<li>` elements are nested inside the `<ul>`, making them child nodes of the `<ul>` in the DOM.
C The `<ul>` and `<li>` elements are siblings in the DOM tree.
D The `<ul>` is a child of each `<li>` element.

Answers and explanations are in the Veda app.

Q105. Why is HTML considered a **markup language** rather than a **programming language**?

Intermediate
A HTML can perform arithmetic calculations using tags like `<math>`.
B HTML uses tags to annotate and describe the structure of content, but it lacks logic constructs like loops and conditionals.
C HTML supports variables and functions, similar to JavaScript.
D HTML is compiled into machine code before being displayed in a browser.

Answers and explanations are in the Veda app.

Q106. A developer writes the following HTML: ```html <img src="logo.png" alt="Company Logo"> ``` Which of the following best explains the role of the `alt` attribute in terms of accessibility and SEO?

Intermediate
A The `alt` attribute is used to resize the image on the page.
B The `alt` attribute provides a text alternative for screen readers and helps search engines understand the image content.
C The `alt` attribute controls the border color of the image.
D The `alt` attribute is optional and has no impact on accessibility or SEO.

Answers and explanations are in the Veda app.

Q107. Compare the following two approaches for creating a heading on a web page: - Approach A: `<h1>Welcome</h1>` - Approach B: `<div style="font-size: 32px; font-weight: bold;">Welcome</div>` Which statement correctly explains the advantage of Approach A?

Intermediate
A Approach A is the only way to create a heading that is centered on the page.
B Approach A uses semantic HTML, which improves accessibility for screen readers and helps search engines understand the page structure.
C Approach B is invalid HTML because `<div>` cannot contain text.
D Approach A is more concise and always displays the heading in a larger font than Approach B.

Answers and explanations are in the Veda app.

Q108. Which of the following best explains why modern best practice separates HTML structure from CSS presentation, as opposed to using tags like `<font>` and `<center>`?

Intermediate
A Separation of concerns makes code cleaner, easier to maintain, and improves accessibility by keeping semantic meaning intact.
B Using `<font>` and `<center>` is faster for the browser to render than CSS.
C HTML cannot include any styling information, so CSS must always be used separately.
D CSS cannot be used to style elements that are defined with semantic HTML tags.

Answers and explanations are in the Veda app.

Topper level · 12 questions

Q109. A developer writes the following HTML document: ```html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>My Page</title> <script src="large.js"></script> </head> <body> <h1>Welcome</h1> <p>Content</p> </body> </html> ``` The developer wants to improve perceived performance. Which of the following changes to the document structure would MOST effectively reduce the time users wait before seeing visible content, assuming `large.js` is a blocking script?

Advanced
A Remove the `<meta charset="UTF-8">` tag to reduce HTTP requests.
B Move the `<script>` tag to the end of the `<body>`, just before `</body>`.
C Add a `defer` attribute to the `<script>` tag while keeping it in the `<head>`.
D Move the `<link>` tag for CSS into the `<body>` to free up the `<head>` for the script.

Answers and explanations are in the Veda app.

Q110. Consider the following HTML document: ```html <!DOCTYPE html> <html> <head> <title>Test</title> <style> body { background: red; } </style> </head> <body> <p>Hello</p> <script> document.title = "New Title"; </script> </body> </html> ``` A validator reports that the document is malformed. Which of the following is the MOST accurate description of the structural error?

Advanced
A The `<style>` element is not allowed inside the `<head>`; it must be placed in the `<body>`.
B The document is missing the `lang` attribute on the `<html>` element, which is required for validity.
C The `<script>` element in the `<body>` modifies the `<title>`, which is invalid because the `<title>` is already closed.
D The document is actually valid; the validator is incorrect.

Answers and explanations are in the Veda app.

Q111. A developer encounters a webpage that renders differently in Internet Explorer 11 compared to Chrome. The developer inspects the source and finds the first line is: ```html <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> ``` The developer wants the page to render consistently in modern browsers using HTML5 standards. Which of the following is the CORRECT change to the document structure?

Advanced
A Remove the DOCTYPE entirely; modern browsers will default to HTML5 mode.
B Keep the existing DOCTYPE but add `<!DOCTYPE html>` as a second line to override it.
C Replace the DOCTYPE with `<!DOCTYPE html>` and add `<meta charset="UTF-8">` in the `<head>`.
D Change the DOCTYPE to `<!DOCTYPE HTML>` and add `lang="en"` to the `<html>` tag.

Answers and explanations are in the Veda app.

Q112. A developer writes the following HTML: ```html <!DOCTYPE html> <html lang="en"> <body> <h1>Title</h1> <head> <title>Page Title</title> <link rel="stylesheet" href="style.css"> </head> <p>Content</p> </body> </html> ``` The page loads, but the CSS does not apply and the browser tab shows an empty title. Which of the following BEST explains the behavior?

Advanced
A The `lang="en"` attribute on `<html>` overrides the `<title>` element, causing it to be ignored.
B The `<head>` element is a void element and cannot contain child elements; the browser automatically closes it before the `<title>`.
C The browser treats the `<head>` as a semantic sectioning element and moves its content to the correct location automatically.
D The `<head>` element is placed inside the `<body>`, so the browser ignores the `<title>` and `<link>` tags because they are not in the document's `<head>`.

Answers and explanations are in the Veda app.

Q113. A developer is building a multilingual website. The page for English users starts with: ```html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Welcome</title> </head> <body> <p>Hello</p> </body> </html> ``` The developer wants to create a Spanish version of the same page. Which of the following changes to the document structure is BOTH necessary and sufficient to ensure the page is correctly interpreted as Spanish by browsers and assistive technologies?

Advanced
A Change the `lang` attribute to `lang="es"` on the `<html>` tag and update the `<title>` and `<p>` content to Spanish.
B Only change the `lang` attribute to `lang="es"` on the `<html>` tag; the content language is automatically inferred.
C Change the `<meta charset="UTF-8">` to `<meta charset="ISO-8859-1">` to support Spanish characters.
D Add a second `<html>` element with `lang="es"` and place the Spanish content inside it.

Answers and explanations are in the Veda app.

Q114. Consider the following HTML snippet: ```html <article> <h2>Title</h2> <p>Content <strong>important</strong> text.</p> </article> ``` If a developer wants to ensure that the `<strong>` element is semantically correct for conveying strong importance, which of the following best describes the relationship between `<strong>` and `<p>` in this snippet?

Advanced
A The `<strong>` element is a sibling of the `<p>` element because they are both inside `<article>`.
B The `<strong>` element is a parent of the `<p>` element because it contains the word 'important'.
C The `<strong>` element is a descendant of `<article>` but not directly nested inside `<p>`.
D The `<strong>` element is a child of the `<p>` element, and the `<p>` element is a child of the `<article>` element.

Answers and explanations are in the Veda app.

Q115. An HTML document contains the following code: ```html <p>First paragraph <p>Second paragraph</p> ``` What is the most likely outcome when a browser renders this code, and why?

Advanced
A Both paragraphs are displayed correctly because browsers automatically add closing tags for `<p>` elements.
B The browser throws an error and refuses to render the page because the first `<p>` is missing its closing tag.
C Only 'Second paragraph' is displayed because the missing closing tag causes the first paragraph to be ignored.
D The text 'First paragraph' is displayed as a heading because the browser interprets the missing closing tag as a formatting error.

Answers and explanations are in the Veda app.

Q116. Which of the following statements correctly compares the `<b>` tag and the `<strong>` tag in modern HTML, considering both semantics and rendering?

Advanced
A `<b>` is preferred over `<strong>` because it is more widely supported in older browsers.
B `<strong>` adds semantic importance to the enclosed text, while `<b>` only applies bold styling without conveying importance.
C Both `<b>` and `<strong>` are purely stylistic and have no semantic meaning; they are interchangeable.
D `<strong>` is used for visual emphasis only, while `<b>` is used for structural importance.

Answers and explanations are in the Veda app.

Q117. A developer writes the following HTML: ```html <nav> <a href="/home">Home</a> <a href="/about">About</a> </nav> ``` Which of the following best explains why using `<nav>` for a navigation menu is preferred over using a generic `<div>` with a class like `class="nav"`?

Advanced
A The `<nav>` tag is required by HTML5 for any group of links, whereas a `<div>` would cause a validation error.
B The `<nav>` tag is faster to render than a `<div>` because browsers optimize navigation elements.
C The `<nav>` tag automatically styles the links as a horizontal menu, while a `<div>` requires additional CSS.
D The `<nav>` tag provides semantic meaning, improving accessibility for screen readers and aiding search engines in understanding the page structure.

Answers and explanations are in the Veda app.

Q118. Given the following HTML snippet: ```html <html> <head> <title>My Page</title> </head> <body> <article> <h1>Welcome</h1> <p>This is a paragraph.</p> <img src="photo.jpg" alt="Photo"> </article> </body> </html> ``` Which of the following best describes the relationship between the `<article>` element and the `<img>` element in terms of the Document Object Model (DOM)?

Advanced
A The `<article>` element is a parent of the `<body>` element, and the `<img>` is a child of the `<article>`.
B The `<img>` element is a sibling of the `<article>` element because both are inside the `<body>`.
C The `<img>` element is a child of the `<article>` element, and the `<article>` element is a descendant of the `<body>` element.
D The `<img>` element is a descendant of the `<h1>` element because it appears after it in the source order.

Answers and explanations are in the Veda app.

Q119. A developer writes the following HTML for a navigation menu: ```html <nav> <ul> <li><a href="/home">Home</a></li> <li><a href="/about">About</a></li> </ul> </nav> ``` Which statement best evaluates the impact of using the `<nav>` element versus a generic `<div>` with the same content, considering accessibility and SEO?

Advanced
A Using `<nav>` improves accessibility but harms SEO because search engines ignore semantic elements.
B Using `<nav>` improves SEO but harms accessibility because screen readers cannot parse semantic elements.
C Using `<nav>` improves accessibility by allowing screen readers to identify the navigation region, and improves SEO by helping search engines understand the page structure.
D Using `<nav>` has no impact on accessibility or SEO because both render the same visually.

Answers and explanations are in the Veda app.

Q120. Consider the following two approaches to create a red, bold heading: **Approach A:** ```html <h1 style="color: red; font-weight: bold;">Important Heading</h1> ``` **Approach B:** ```html <div style="font-size: 32px; color: red; font-weight: bold;">Important Heading</div> ``` Which statement correctly analyzes the advantages of Approach A over Approach B in terms of modern best practices?

Advanced
A Approach A is better because it uses a heading tag, which provides semantic meaning for accessibility and SEO, while Approach B uses a generic `<div>` that lacks semantic structure.
B Both approaches are equally valid because they produce the same visual result, and modern best practices only care about visual appearance.
C Approach A is worse because inline styles are discouraged, and Approach B uses a `<div>` which is the recommended element for headings.
D Approach B is better because it uses a `<div>` which is more flexible for styling, and the `font-size` property ensures consistent rendering across browsers.

Answers and explanations are in the Veda app.

Flashcards

Tap a card to flip it

83 flashcards in this kit — the app reviews them with spaced repetition so the right card returns on the right day.

Learning games

Play your way through this kit

Every game is built from this kit's own content — scores feed your mastery, so playing counts as studying.

🎮

Word Match

Built from this kit's own content

🎮

True False

Built from this kit's own content

🎮

Fill Blank

Built from this kit's own content

🎮

Memory Match

Built from this kit's own content

🎮

Flashcard Battle

Built from this kit's own content

🎮

Speed Quiz

Built from this kit's own content

🎮

Fact Or Myth

Built from this kit's own content

🎮

Guess Term

Built from this kit's own content

🎮

Sequence Builder

Built from this kit's own content

🎮

Concept Connection

Built from this kit's own content

🎮

Categorization

Built from this kit's own content

🎮

Revision Battle

Built from this kit's own content

Playable in the app

Study it properly — free, in the app

The full Veda Bites deck, complete notes, spaced-repetition flashcards, leveled MCQs, tests and games for this kit — plus Daily Facts and the Arena, every day.