HTML Web Laboratory: Viva Questions

Subject: Web Programming Laboratory
Topic: HTML Basics to HTML5
Last Updated: January 8, 2026

Part I: Viva Voce Questions

1. Basic HTML Concepts

  1. What is HTML? Explain its full form and purpose.
  2. What is the latest version of HTML? Name two important new features introduced in it.
  3. What is a markup language? How is HTML different from a programming language?
  4. What is the basic structure of an HTML document? Write the minimal HTML5 page.
  5. What is the purpose of the <!DOCTYPE html> declaration?

2. HTML Tags and Elements

  1. What are HTML tags? Give the syntax of a typical HTML tag.
  2. Differentiate between block-level and inline elements. Give two examples of each.
  3. What is the difference between a container tag and an empty (void) tag? Give examples.
  4. How many heading levels are there in HTML? Which one is the most important?
  5. What is the purpose of the <p> tag? How is it different from <br>?

3. Document Structure

  1. What is the role of the <head> tag in an HTML document?
  2. What is the purpose of the <title> tag? Where is it displayed?
  3. What is the <body> tag used for? What kind of content goes inside it?
  4. What is the <meta> tag? Give one use of it (e.g., charset or description).
  5. What is the <style> tag used for? Where is it usually placed?

4. Text Formatting and Lists

  1. Name HTML tags used to make text bold, italic, and underlined.
  2. What is the difference between <b> and <strong>?
  3. What are the different types of lists in HTML? Give their tags.
  4. How do you create an ordered list? How do you change its starting number?
  5. How do you create an unordered list with custom bullet style (e.g., disc, circle, square)?

5. Links and Images

  1. What is the <a> tag used for? What is the purpose of the href attribute?
  2. How do you make a hyperlink open in a new tab/window?
  3. How do you create an email link using the <a> tag?
  4. How do you insert an image in HTML? What are the required attributes of the <img> tag?
  5. Why is the alt attribute important in the <img> tag?

6. Tables

  1. Which tags are used to create a table in HTML?
  2. What is the difference between <th> and <td>?
  3. How do you merge cells in a table? Explain rowspan and colspan with an example.
  4. What is the difference between cellspacing and cellpadding?
  5. How do you give a border to an HTML table?

7. Forms

  1. What is the purpose of the <form> tag? Name its important attributes.
  2. What is the difference between method="get" and method="post" in a form?
  3. Name different input types used in HTML forms (e.g., text, password, checkbox, etc.).
  4. What is the purpose of the <label> tag in a form?
  5. How do you create a dropdown list in HTML? Which tags are used?

8. HTML5 and Advanced Tags

  1. What are semantic elements in HTML5? Give three examples.
  2. How does HTML5 support audio and video? Name the relevant tags.
  3. What is the purpose of the <div> and <span> tags? How are they different?
  4. What is the <marquee> tag? Is it recommended in modern HTML? Why?
  5. How can you set a background image for a web page using HTML?

9. Practical / Lab-Based Questions

  1. Write HTML code to create a simple web page with a heading, a paragraph, and a link.
  2. Write HTML code to create a table with 3 rows and 3 columns.
  3. Write HTML code to create a form with name, email, and submit button.
  4. How do you add comments in HTML? Give the syntax.
  5. What are the common mistakes students make while writing HTML code in the lab?

Part II: Quick Reference & Sample Answers

Q1: What is HTML?

HTML stands for HyperText Markup Language. It is a markup language used to create web pages by using a set of tags and attributes to structure and format content. HTML provides the structure and semantic meaning to web content.

Q4: Minimal HTML5 Page Structure

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Page Title</title>
</head>
<body>
    <h1>Hello World</h1>
    <p>This is a paragraph.</p>
</body>
</html>

Q7: Block vs Inline Elements

Q17: <b> vs <strong>

Q26: Table Tags

Q31: Form Tag Overview

The <form> tag creates an HTML form for user input.

Important attributes:

Q42: Practical Example - Table

<table border="1">
    <tr>
        <th>Header 1</th>
        <th>Header 2</th>
        <th>Header 3</th>
    </tr>
    <tr>
        <td>Data 1</td>
        <td>Data 2</td>
        <td>Data 3</td>
    </tr>
</table>

Q43: Practical Example - Form

<form action="/submit" method="post">
    <label for="name">Name:</label>
    <input type="text" id="name" name="name" required>
    
    <label for="email">Email:</label>
    <input type="email" id="email" name="email" required>
    
    <button type="submit">Submit</button>
</form>

Q44: HTML Comments Syntax

Comments are not displayed in the browser but help developers understand the code.

<!-- This is a single-line comment -->

<!-- 
  This is a 
  multi-line comment 
-->