HTML Basics Quiz
Test your knowledge of HTML fundamentals
About this HTML quiz
This beginner-level quiz has 10 questions covering basics, introduction, elements. You have 15 minutes, and you need 70% to pass. Every question comes with an explanation, so a wrong answer still teaches you something. Questions mix multiple choice, multiple answer and true/false formats.
Revise before you start
Answers and explanations
Show all 10 answers (spoilers)
What does HTML stand for?
Answer: Hyper Text Markup Language
HTML stands for HyperText Markup Language, which is the standard markup language for creating web pages.
Which HTML tag is used to create a heading?
Answer: <h1>
The <h1> tag is used to create headings in HTML. There are six levels of headings from <h1> to <h6>.
Which of the following are valid HTML5 semantic elements?
Answer: <header>, <nav>, <section>, <article>, <footer>
All of these except <div> are HTML5 semantic elements. <div> is a generic container without semantic meaning.
HTML tags are case-sensitive.
Answer: False
HTML tags are not case-sensitive, but it's best practice to use lowercase for consistency.
What is the correct HTML for creating a link?
Answer: <a href="http://example.com">Link</a>
The <a> tag with the href attribute is used to create links in HTML.
Complete the HTML structure: <!DOCTYPE html><html><___><title>Page Title</title></___><body></body></html>
Answer: head
The <head> element contains metadata about the document and is not displayed on the page.
Which attribute specifies the destination of a link?
Answer: href
The href attribute specifies the URL of the page the link goes to.
What does the following code create? <img src="image.jpg" alt="A beautiful sunset">
<img src="image.jpg" alt="A beautiful sunset">Answer: An image with alt text
The <img> tag creates an image element, and the alt attribute provides alternative text for accessibility.
Which of the following are self-closing HTML tags?
Answer: <br>, <img>, <input>, <hr>
Self-closing tags don't need a closing tag. Common examples include <br>, <img>, <input>, and <hr>.
What is the purpose of the DOCTYPE declaration?
Answer: To specify the HTML version
The DOCTYPE declaration tells the browser which version of HTML the page is written in.
Want more practice? Browse all web development quizzes or try the code yourself in the live playground.