HTML Comprehensive Quiz
Evaluate your HTML mastery through 50 thoughtfully designed assessment questions
About This Quiz
Practice HTML concepts with 50 source questions and answer explanations. This is a learning exercise, not a validated measurement of professional proficiency.
Quiz Information
- Total Questions: 50 questions covering all aspects of HTML
- Question Format: Multiple choice with 4 options each
- Time Limit: No time limit - take your time to think
- Passing Score: 70% (35 correct answers) is considered a good score
- Difficulty: Questions range from beginner to advanced level
- Feedback: Instant feedback with explanations for each answer
Topics Covered
This assessment encompasses complete HTML subject matter spanning your educational journey:
HTML Basics
- HTML structure and syntax
- Elements and attributes
- Headings and paragraphs
- Text formatting
- Comments and entities
Styling & Layout
- HTML and CSS integration
- Classes and IDs
- Semantic HTML
- Page layout techniques
- Responsive design
Links & Media
- Hyperlinks and navigation
- Images and favicons
- Video and audio
- YouTube embedding
- File paths
Forms & Input
- Form elements
- Input types
- Form attributes
- Form validation
- Input attributes
Tables & Lists
- Table structure
- Table formatting
- Ordered lists
- Unordered lists
- Description lists
Graphics
- Canvas API
- SVG graphics
- Drawing shapes
- Canvas vs SVG
HTML5 APIs
- Geolocation API
- Drag and Drop
- Web Storage
- Web Workers
Advanced Topics
- HTML vs XHTML
- Character sets
- URL encoding
- Best practices
- Accessibility
How to Take the Quiz
- Click the "Start Quiz" button below to begin
- Read each question carefully
- Select the answer you think is correct
- Click "Next" to move to the next question
- You can navigate back to previous questions if needed
- At the end, you'll see your score and detailed results
- Review the explanations to learn from any mistakes
Tips for Success
- Take your time - there's no time limit
- Read all options before selecting your answer
- If you're unsure, think about what you've learned in the tutorials
- Don't worry if you don't get everything right - learning is a process
- Review the explanations to understand concepts better
- Retake the quiz after studying to improve your score
Ready to Test Your HTML Knowledge?
Challenge yourself with 50 comprehensive questions!
Quiz Complete!
Your Score: 0 out of 50
Review Your Answers
Practice the 50 source questions
Choose an answer to each question. Results and explanations appear after you finish; no answer is submitted to a server.
Read all questions and explanations
What does HTML stand for?
- Hyper Text Markup Language
- High Tech Modern Language
- Home Tool Markup Language
- Hyperlinks and Text Markup Language
Answer and explanation
Hyper Text Markup Language — HTML stands for Hyper Text Markup Language. It's the standard markup language for creating web pages.
Which HTML tag defines the highest-level section heading?
- <heading>
- <h6>
- <h1>
- <head>
Answer and explanation
<h1> — The h1 element defines the highest-level heading. Heading levels express structure; CSS determines their visual size.
What is the correct HTML element for inserting a line break?
- <lb>
- <break>
- <br>
- <newline>
Answer and explanation
<br> — The <br> tag inserts a single line break. It's an empty element with no closing tag.
Which character is used to indicate an end tag in HTML?
- *
- /
- \
- ^
Answer and explanation
/ — The forward slash (/) is used in end tags. For example: </p> closes a paragraph tag.
What is the correct HTML for creating a hyperlink?
- <a url="http://example.com">Example</a>
- <a href="http://example.com">Example</a>
- <a link="http://example.com">Example</a>
- <link href="http://example.com">Example</link>
Answer and explanation
<a href="http://example.com">Example</a> — The <a> tag with href attribute creates a hyperlink: <a href="URL">Link Text</a>
Which HTML attribute specifies an alternate text for an image?
- title
- alt
- src
- text
Answer and explanation
alt — The alt attribute provides alternative text for images if they cannot be displayed. It's also important for accessibility.
What is the correct HTML element for the title of a document?
- <head>
- <title>
- <meta>
- <header>
Answer and explanation
<title> — The <title> tag defines the title of the document shown in the browser's title bar or page tab.
Which HTML element defines the document type?
- <doctype>
- <!DOCTYPE html>
- <html>
- <document>
Answer and explanation
<!DOCTYPE html> — <!DOCTYPE html> is the document type declaration for HTML5. It must be the very first thing in your HTML document.
How can you make a numbered list in HTML?
- <ul>
- <ol>
- <list>
- <nl>
Answer and explanation
<ol> — The <ol> tag creates an ordered (numbered) list. Use <ul> for unordered (bulleted) lists.
Which HTML tag is used to define an internal stylesheet?
- <script>
- <css>
- <style>
- <stylesheet>
Answer and explanation
<style> — The <style> tag is used to define internal CSS styles within an HTML document.
Which attribute is used to uniquely identify an HTML element?
- class
- name
- id
- key
Answer and explanation
id — The id attribute uniquely identifies an element. Each id value must be unique within the page.
What is the correct HTML for making a text bold?
- <b>
- <bold>
- <strong>
- Both <b> and <strong>
Answer and explanation
Both <b> and <strong> — Both <b> and <strong> make text bold, but <strong> also indicates semantic importance.
Which HTML element is used to specify a footer for a document?
- <bottom>
- <section>
- <footer>
- <foot>
Answer and explanation
<footer> — The <footer> element represents a footer for a document or section. It's a semantic HTML5 element.
What is the correct HTML for inserting an image?
- <img src="image.jpg" alt="My Image">
- <image src="image.jpg">
- <img href="image.jpg">
- <picture src="image.jpg">
Answer and explanation
<img src="image.jpg" alt="My Image"> — The <img> tag with src attribute inserts an image. The alt attribute provides alternative text.
Which input type defines a slider control?
- slider
- controls
- range
- scroll
Answer and explanation
range — The input type="range" creates a slider control for selecting a value within a range.
What is the correct HTML for making a checkbox?
- <input type="check">
- <input type="checkbox">
- <checkbox>
- <check>
Answer and explanation
<input type="checkbox"> — The <input type="checkbox"> creates a checkbox input field.
Which HTML attribute is used to define inline styles?
- font
- class
- styles
- style
Answer and explanation
style — The style attribute is used to add inline CSS styles directly to HTML elements.
What is the purpose of the <div> element?
- To divide the page
- To create a division or section
- To make text italic
- To create a table
Answer and explanation
To create a division or section — The <div> element is a container used to group and style block-level content.
Which HTML element defines navigation links?
- <navigate>
- <nav>
- <navigation>
- <menu>
Answer and explanation
<nav> — The <nav> element defines a section of navigation links. It's a semantic HTML5 element.
What does the <meta> tag do?
- Creates metadata
- Provides metadata about the HTML document
- Creates a meter
- Defines metrics
Answer and explanation
Provides metadata about the HTML document — The <meta> tag provides metadata about the HTML document, such as description, keywords, and character set.
Which HTML tag is used to define a table row?
- <td>
- <tr>
- <table>
- <th>
Answer and explanation
<tr> — The <tr> tag defines a table row. It contains <td> (data cells) or <th> (header cells).
What is the correct HTML for defining a table header?
- <td>
- <th>
- <head>
- <header>
Answer and explanation
<th> — The <th> tag defines a header cell in a table. Content is bold and centered by default.
Which HTML element is used to define description lists?
- <ol>
- <ul>
- <dl>
- <list>
Answer and explanation
<dl> — The <dl> tag defines a description list, containing <dt> (terms) and <dd> (descriptions).
How do you create an unordered list?
- <ol>
- <ul>
- <list>
- <ulist>
Answer and explanation
<ul> — The <ul> tag creates an unordered (bulleted) list. Each item is defined with <li>.
What attribute merges table cells horizontally?
- rowspan
- colspan
- merge
- span
Answer and explanation
colspan — The colspan attribute specifies how many columns a cell should span horizontally.
Which attribute specifies where to send form data when submitted?
- method
- action
- submit
- target
Answer and explanation
action — The action attribute specifies the URL where form data should be sent when the form is submitted.
What is the default method for form submission?
- POST
- GET
- PUT
- SEND
Answer and explanation
GET — GET is the default method. It appends form data to the URL. POST is more secure for sensitive data.
Which input type is used for email addresses?
- text
Answer and explanation
email — The input type="email" validates email addresses and shows appropriate keyboard on mobile devices.
What does the required attribute do?
- Makes a field visible
- Makes a field mandatory
- Validates the field
- Highlights the field
Answer and explanation
Makes a field mandatory — The required attribute specifies that an input field must be filled before submitting the form.
Which element creates a drop-down list?
- <list>
- <dropdown>
- <select>
- <option>
Answer and explanation
<select> — The <select> element creates a drop-down list, containing <option> elements.
What is the purpose of the placeholder attribute?
- To set default value
- To show hint text
- To validate input
- To label the field
Answer and explanation
To show hint text — The placeholder attribute provides a hint that describes the expected value of an input field.
Which attribute prevents editing of an input field?
- disabled
- readonly
- locked
- fixed
Answer and explanation
readonly — Both readonly and disabled prevent editing, but readonly fields are submitted with the form while disabled fields are not.
Which element is used to embed video in HTML5?
- <movie>
- <video>
- <media>
- <embed>
Answer and explanation
<video> — The <video> element is used to embed video content in HTML5 without plugins.
What attribute adds controls to a video player?
- play
- controls
- buttons
- control
Answer and explanation
controls — The controls attribute adds video controls like play, pause, and volume to the video element.
Which format is most widely supported for HTML5 video?
- AVI
- MP4
- WMV
- MOV
Answer and explanation
MP4 — MP4 (with H.264 codec) is the most widely supported video format across all modern browsers.
How do you embed a YouTube video in HTML?
- <video src="youtube.com/...">
- <youtube>
- <iframe src="youtube.com/embed/...">
- <embed youtube>
Answer and explanation
<iframe src="youtube.com/embed/..."> — YouTube videos are embedded using an <iframe> element with the YouTube embed URL.
Which element is used to play sound files?
- <sound>
- <audio>
- <music>
- <mp3>
Answer and explanation
<audio> — The <audio> element is used to embed audio content in HTML5.
Which element is used to draw graphics via JavaScript?
- <graphics>
- <canvas>
- <draw>
- <svg>
Answer and explanation
<canvas> — The <canvas> element provides a bitmap surface for drawing graphics using JavaScript.
What does SVG stand for?
- Simple Vector Graphics
- Scalable Vector Graphics
- Standard Visual Graphics
- Styled Vector Graphics
Answer and explanation
Scalable Vector Graphics — SVG stands for Scalable Vector Graphics. It's XML-based and resolution-independent.
Which method gets the 2D drawing context from a canvas?
- getContext('2d')
- get2DContext()
- context2d()
- drawContext()
Answer and explanation
getContext('2d') — The getContext('2d') method returns the 2D drawing context for the canvas element.
What is the main difference between Canvas and SVG?
- Canvas uses XML
- SVG is resolution-dependent
- Canvas is raster-based, SVG is vector-based
- They are the same
Answer and explanation
Canvas is raster-based, SVG is vector-based — Canvas creates raster (bitmap) graphics, while SVG creates vector graphics that scale without quality loss.
Which SVG element draws a circle?
- <round>
- <circle>
- <ellipse>
- <arc>
Answer and explanation
<circle> — The <circle> element draws a circle in SVG with cx, cy (center) and r (radius) attributes.
Which API allows you to get the user's location?
- Location API
- GPS API
- Geolocation API
- Position API
Answer and explanation
Geolocation API — The Geolocation API allows web applications to access the user's geographical location.
Which storage persists even after the browser is closed?
- sessionStorage
- localStorage
- cookieStorage
- tempStorage
Answer and explanation
localStorage — localStorage persists data even after the browser is closed, unlike sessionStorage.
What is the storage limit for Web Storage?
- 4 KB
- 1 MB
- 5-10 MB
- Unlimited
Answer and explanation
5-10 MB — Web Storage (localStorage and sessionStorage) typically allows 5-10 MB per origin.
Which attribute makes an element draggable?
- drag='true'
- draggable='true'
- candrag='true'
- isdraggable='true'
Answer and explanation
draggable='true' — The draggable='true' attribute makes an element draggable in the Drag and Drop API.
What is the main purpose of Web Workers?
- Store data
- Run JavaScript in background
- Make AJAX calls
- Manage cookies
Answer and explanation
Run JavaScript in background — Web Workers allow JavaScript to run in background threads without blocking the UI.
Can Web Workers access the DOM?
- Yes, full access
- Yes, read-only
- No, no access
- Only with permission
Answer and explanation
No, no access — Web Workers cannot access the DOM. They run in an isolated context without access to window or document.
What is the difference between HTML and XHTML?
- No difference
- XHTML is stricter and follows XML rules
- HTML is newer
- XHTML is for mobile only
Answer and explanation
XHTML is stricter and follows XML rules — XHTML is stricter than HTML and must follow XML rules (proper nesting, lowercase tags, quoted attributes).
What does the charset attribute in meta tag specify?
- Character encoding
- Character set name
- Both A and B
- Font family
Answer and explanation
Both A and B — The charset attribute specifies the character encoding for the HTML document, typically UTF-8.