Practice Questions – HTML
Q1. Basic Structure
-
Create a simple HTML document with:
-
A title “My First Webpage”
-
A heading “Welcome to My Website”
-
A paragraph introducing yourself.
-
Q2. Headings, Paragraphs, Links, Images
-
Create a webpage that:
-
Contains headings from
<h1>to<h6>with sample text. -
A paragraph describing your favorite hobby.
-
A hyperlink that redirects to https://www.wikipedia.org.
-
An image of your choice (use any online image URL).
-
Q3. Lists
-
Create:
-
An ordered list of 5 programming languages.
-
An unordered list of 5 fruits.
-
Q4. Tables
-
Create a table that displays:
-
Student Name, Roll Number, and Marks (3 rows of data).
-
Use
<thead>for headings and<tbody>for data. -
Add a border to the table.
-
Q5. Forms
-
Create a form that asks for:
-
Name (text input)
-
Email (email input)
-
Gender (radio buttons: Male, Female, Other)
-
Favorite Subject (select dropdown with 3 options)
-
A “Submit” button
-
Q6. Semantic HTML
-
Create a webpage layout with:
-
<header>containing a site title. -
<nav>with links to Home, About, Contact. -
<section>with a short article. -
<footer>with your copyright notice.
-
Q7. Multimedia
-
Add:
-
An audio player to play an MP3 file.
-
A video player that plays an MP4 file.
-
An iframe that embeds a YouTube video.
-
Q8. Best Practices
-
Write an HTML document that:
-
Uses semantic tags wherever possible.
-
Has proper indentation and comments.
-
Includes
alttext for images. -
Uses a descriptive
<title>and<meta charset="UTF-8">.
-
