Q1. Which HTML tag is used to create a paragraph?
- A.<pg>
- B.<para>
- C.<p>✓ Correct
- D.<text>
Explanation
The <p> tag defines a paragraph in HTML.
Topic in Web Development
HTML (HyperText Markup Language) is the standard markup language that defines the structure and meaning of web page content using elements and attributes. Basic MCQs ask which tag creates a paragraph, link, image, list or table, and what attributes like href, src, alt and id do. Semantic HTML5 elements are a big area: header, nav, main, section, article, aside and footer, and when to prefer each over a div. Forms bring questions on input types, labels, fieldset, and validation attributes such as required and pattern. More advanced items cover the DOCTYPE, meta tags, accessibility with ARIA, responsive images using srcset and sizes, and Shadow DOM.
Below are 30 practice questions from a pool of 210 HTML Fundamentals MCQs, one of 17 topics in Web Development. Each shows the correct answer with an explanation; when you are ready, take a timed quiz to test recall under exam conditions.
Each question below shows the correct answer with a full explanation. Use these to build conceptual understanding before attempting a timed quiz.
Q1. Which HTML tag is used to create a paragraph?
The <p> tag defines a paragraph in HTML.
Q2. What is the correct HTML tag for the largest heading?
The <h1> tag defines the largest heading in HTML.
Q3. Which HTML tag is used to create a hyperlink?
The <a> (anchor) tag creates hyperlinks in HTML.
Q4. Which attribute specifies the URL in an anchor tag?
The href attribute specifies the URL that the hyperlink points to.
Q5. What is the correct HTML tag for inserting an image?
The <img> tag embeds images in HTML.
Q6. Which HTML tag creates an unordered list?
The <ul> tag creates an unordered (bulleted) list.
Q7. What does the <br> tag do?
The <br> tag inserts a single line break.
Q8. Which HTML tag makes text bold?
Both <b> and <strong> make text bold; <strong> also conveys semantic importance.
Q9. What is the root element of an HTML document?
The <html> tag is the root element that wraps all content.
Q10. Which tag defines a table row in HTML?
The <tr> tag defines a row within an HTML table.
Q11. What is the purpose of the <meta> tag?
The <meta> tag provides metadata such as character set, viewport settings, and descriptions.
Q12. Which HTML5 tag is used for navigation links?
The <nav> tag defines a section of navigation links in HTML5.
Q13. What is the difference between <div> and <span>?
<div> is a block-level container, while <span> is inline.
Q14. Which attribute provides alternative text for an image?
The alt attribute provides alternative text for accessibility and when images fail to load.
Q15. What is the purpose of the <form> tag?
The <form> tag creates a form that collects user input.
Q16. Which input type creates a checkbox?
Setting type='checkbox' on an <input> creates a checkbox.
Q17. What is the purpose of the action attribute in a form?
The action attribute specifies the URL where form data is sent.
Q18. Which HTML5 element is used for self-contained content like a blog post?
The <article> element represents self-contained content.
Q19. What does target='_blank' do in an anchor tag?
target='_blank' opens the linked URL in a new tab or window.
Q20. Which tag embeds a video in HTML5?
The <video> tag embeds video content in HTML5.
Q21. What is the purpose of the data-* attribute in HTML5?
data-* attributes store custom data on elements accessible via JavaScript's dataset property.
Q22. What is the Shadow DOM?
The Shadow DOM provides encapsulation by attaching a hidden DOM tree to an element.
Q23. What is the purpose of the <template> tag in HTML5?
The <template> tag holds HTML content not rendered until instantiated via JavaScript.
Q24. Which attribute makes an HTML element editable?
The contenteditable attribute makes an element's content editable directly in the browser.
Q25. What is the purpose of the srcset attribute in <img>?
srcset allows the browser to choose the best image source based on device resolution.
Q26. What is an HTML Web Component?
Web Components combine Custom Elements, Shadow DOM, and HTML Templates for reusable elements.
Q27. What does the defer attribute do on a <script> tag?
defer downloads the script without blocking parsing and executes it after the document is fully parsed.
Q28. What is the difference between defer and async in script loading?
defer executes after parsing in document order, while async executes immediately when downloaded.
Q29. What is ARIA in HTML?
ARIA provides attributes that make dynamic web content more accessible to users with disabilities.
Q30. What is the purpose of the <picture> element in HTML5?
The <picture> element allows the browser to choose the best image based on media conditions.
Practice MCQs with explanations
Practice MCQs with explanations
Practice MCQs with explanations
Practice MCQs with explanations
Practice MCQs with explanations
Practice MCQs with explanations
Take a timed quiz drawn from 210+ questions on this topic. No signup required — your progress saves in your browser.
Start HTML Fundamentals Quiz