HTML Quiz Questions
Quiz 1. Basic HTML Structure
1. What is the correct HTML element for the largest heading?
<head>
<h1>
<heading>
<h6>
2. Which tag is used to define an HTML document?
<html>
<doc>
<document>
<body>
3. Which tag is used to include a JavaScript file in an HTML document?
<script src="filename.js">
<js src="filename.js">
<java src="filename.js">
<include src="filename.js">
4. What does the `<title>` tag do?
It specifies the title of the document
It sets the title for an HTML element
It creates a title bar.
It formats the title in bold.
5. Where should the `<meta charset="UTF-8">` tag be placed in an HTML document?
In the `<head>` section
In the `<body>` section
Before the `<!DOCTYPE html>` declaration
After the `<html>` tag
Quiz 2. Text Formatting
1. Which tag is used to make text bold?
<strong>
<bold>
<b>
<em>
2. What is the purpose of the `<em>` tag in HTML?
To emphasize text (typically displayed in italics)
To make text bold
To create a new paragraph
To insert an image
3. Which tag would you use to create a line break in HTML?
<break>
<newline>
<br>
<hr>
4. What does the `<blockquote>` tag do?
It creates a block of quoted text.
It formats text as a quote but inline.
It adds a quote attribution.
It highlights text.
5. ow do you create a hyperlink in HTML?
<a href="url">
<link href="url">
<hyperlink src="url">
<url link="url">
Quiz 3. Lists and Tables
1. Which tag is used to create an unordered list?
<ul>
<ol>
<list>
<li>
2. What does the `<li>` tag represent?
A list item
A list header
A list footer
A list container
3. How do you define a table row in HTML?
<tr>
<row>
<td>
<th>
4. Which tag is used to create a table header cell?
<th>
<td>
<tr>
<header>
5. How do you create a table cell in HTML?
<td>
<cell>
<table>
<th>
Quiz 4 .Forms and Input Elements
1. Which attribute is used to specify the action URL for a form?
action
method
url
submit
2. What is the purpose of the `<input type="text">` tag?
To create a text input field
To create a password input field
To create a checkbox
To create a submit button
3. How can you create a radio button in a form?
<input type=”radio”>
<radio>
<button type=”radio”>
<input type=”checkbox”>
4. What does the `<textarea>` tag do?
Creates a multiline text input field
Creates a single-line text input field
Creates a button for text input
Creates a dropdown list
5. How do you define a form submission button in HTML?
<button type=”submit”>
<input type=”submit”>
<submit>
<formbutton>
Quiz 5 : Multimedia
1. Which tag is used to embed a video in HTML?
<video>
<embed>
<media>
<movie>
2. What attribute is used to specify the source of an image?
src
href
link
source
3. How do you include an audio file in an HTML document?
<audio src="filename.mp3">
<sound src="filename.mp3">
<media src="filename.mp3">
<music src="filename.mp3">
4. Which attribute in the `<img>` tag specifies alternative text for an image?
alt
title
desc
text
5. How do you create an inline frame (iframe) in HTML?
<iframe>
<frame>
<inline>
<embed>
HTML Exercises
Exercise 1: Basic HTML Structure
1. Create a basic HTML document structure with a heading "Welcome to My Website" and a
paragraph "This is a sample paragraph."
2. Add a link to "https://www.example.com" with the text "Visit Example" in the body of the
document.
3. Insert an image located at "image.jpg" with alt text "Sample Image" in your HTML
document.
4. Include a JavaScript file named "script.js" in your HTML document.
5. Add a meta tag for UTF-8 character encoding in the head section of your HTML document.
Exercise 2: Text Formatting
1. Write HTML code to create a bold heading and italicized subheading.
2. Create a paragraph with some text emphasized (italicized) and some text strong (bold).
3. Use the `<blockquote>` tag to include a block of quoted text.
4. Add a line break between two sentences in a paragraph.
5. Format a piece of text as underlined and centered using appropriate HTML tags.
Exercise 3: Lists and Tables
1. Create an unordered list with at least three list items.
2. Write HTML code to create an ordered list with five items.
3. Design a table with two rows and three columns. Ensure that the first row contains header
cells.
4. Add a table row with three data cells and format one of the cells as a table header.
5. Insert a table with two columns and four rows, with a table heading in the first row.
Exercise 4: Forms and Input Elements
1. Create a form with a text input field for name, an email input field, and a submit button.
2. Design a form with radio buttons for selecting a gender (Male, Female, Other) and a submit
button.
3. Add a multi-line text area for comments in a form, with a submit button.
4. Create a form with a dropdown list for selecting a country. Include at least three country
options.
5. Design a form with a checkbox for agreeing to terms and conditions and a submit button.
Exercise 5: Multimedia
1. Embed a video file named "video.mp4" in your HTML document.
2. Add an audio file named "audio.mp3" to your HTML page, with controls for play/pause.
3. Insert an image with the file name "logo.png" and set the width to 200 pixels.
4. Include an iframe that embeds a YouTube video (provide a sample YouTube URL).
5. Create an HTML page with a background image using the `<body>` tag’s CSS