Study resource

Read at your pace, then save it for later.

Unit 2: Comprehensive HTML Fundamentals Examination Set

Section A — 1 Mark Questions

1. What does HTML stand for? [1 Mark]

Answer: HyperText Markup Language.

2. Which tag is used to define the largest heading in HTML? [1 Mark]

Answer: The <h1> tag.

3. What is the purpose of an attribute in an HTML tag? [1 Mark]

Answer: It provides additional information about the element, such as source or color.

4. Identify the HTML tag used to create a line break. [1 Mark]

Answer: The <br> tag.

5. Are all HTML tags considered closed tags? [1 Mark]

Answer: No, some are void or empty tags, like <br> or <img>.

6. Which tag is used to create a numbered list? [1 Mark]

Answer: The <ol> tag.

7. What does a URL stand for? [1 Mark]

Answer: Uniform Resource Locator.

8. Which tag is used to create a hyperlink? [1 Mark]

Answer: The <a> tag (anchor tag).

9. How do you define a bulleted list in HTML? [1 Mark]

Answer: By using the <ul> tag.

10. What is the main purpose of the <title> tag? [1 Mark]

Answer: It sets the title of the web page shown in the browser tab.

11. Which attribute is used to specify the background color of a page? [1 Mark]

Answer: The bgcolor attribute (or using CSS background-color).

12. What tag is used for defining a table row? [1 Mark]

Answer: The <tr> tag.

13. Is <b> a container tag or an empty tag? [1 Mark]

Answer: It is a container (paired) tag.

14. Which tag is used to create a text input field in a form? [1 Mark]

Answer: The <input> tag.

15. What does CSS stand for in the context of styling? [1 Mark]

Answer: Cascading Style Sheets.

16. What does the 'href' attribute in an anchor tag define? [1 Mark]

Answer: It defines the destination URL for the link.

17. Which tag is used to define a table header cell? [1 Mark]

Answer: The <th> tag.

18. What is the purpose of the <form> tag? [1 Mark]

Answer: To collect user input data.

19. Which tag is used to create an italicized text style? [1 Mark]

Answer: The <i> or <em> tag.

20. What does a 'target' attribute in an anchor tag accomplish? [1 Mark]

Answer: It specifies where to open the linked document (e.g., in a new tab).

Section B — 2/3 Mark Questions

1. Differentiate between an open tag and a closed tag. [2 Marks]

Answer: An open tag is the starting tag of an element, while a closed tag includes the forward slash (e.g., </p>) to indicate the end of the element's content.

2. List three attributes used within the <form> element. [3 Marks]

Answer: Three common attributes are 'action' (defines where data is sent), 'method' (defines how data is sent, like GET or POST), and 'name' (identifies the form).

3. Explain the difference between ordered and unordered lists with examples. [3 Marks]

Answer: An ordered list (<ol>) uses numbers or letters to denote sequence. An unordered list (<ul>) uses bullet points. For example, a recipe list is ordered, while a shopping list is usually unordered.

4. What is the function of the <head> and <body> tags in an HTML document? [2 Marks]

Answer: The <head> contains metadata, the title, and external links, while the <body> contains the actual visible content of the page.

5. How do you create an external link in HTML? Provide an example. [2 Marks]

Answer: You use the <a> tag with an 'href' attribute. Example: <a href='https://www.google.com'>Visit Google</a>.

6. Name three tags used in table creation and explain their roles. [3 Marks]

Answer: <table> defines the table container; <tr> defines a row; <td> defines a standard data cell within that row.

7. Briefly describe the purpose of using CSS in HTML documents. [2 Marks]

Answer: CSS is used to separate the presentation/design of a webpage from its structure, allowing for better control over layout, colors, and fonts.

8. What is a hyperlink and how does the anchor tag facilitate navigation? [3 Marks]

Answer: A hyperlink is a reference to data that the user can follow. The anchor tag (<a>) creates this link; when clicked, the browser navigates the user to the address specified in the 'href' attribute.

9. Why are empty tags (like <br>) called empty tags? [2 Marks]

Answer: They are called empty tags because they do not contain any content between an opening and closing tag, nor do they require a closing tag.

10. Explain the difference between the <th> and <td> tags. [2 Marks]

Answer: <th> is used for table header cells (typically bold and centered), while <td> is used for standard data cells.

Section C — 5 Mark Questions

1. Explain the structure of an HTML document in detail. [5 Marks]

Answer: A standard HTML document consists of several key structural elements that define how the browser interprets the content.

Key Components

  • <!DOCTYPE html>: Declares the document type and version of HTML being used.
  • <html>: The root element that wraps all content on the page.
  • <head>: Contains metadata, which is information about the document that isn't displayed directly on the page, such as the page title (in <title>) and links to stylesheets.
  • <body>: Contains all the visible content, including text, images, links, and forms.

By organizing code into these sections, developers ensure the document is standards-compliant and correctly rendered by web browsers.

2. Discuss the importance and usage of HTML Forms in web development. [5 Marks]

Answer: Forms are essential for interactive websites as they enable user data collection.

Key Elements

  • <form> tag: Acts as the primary container for all input fields.
  • Input Types: Includes text fields, radio buttons, checkboxes, and buttons.
  • Attributes: The 'action' attribute determines where the data is processed, and the 'method' attribute (GET/POST) determines the transfer method.

Forms allow users to communicate with servers, facilitating tasks like logging in, submitting feedback, or performing searches. Without forms, the web would be a static, read-only experience for users.

3. Describe the process of creating a table in HTML and explain the tags involved. [5 Marks]

Answer: Tables are used to organize data into a grid format.

Table Tags

  • <table>: Defines the start and end of the table structure.
  • <tr>: Defines each individual row.
  • <th>: Defines a header cell, usually bold and centered.
  • <td>: Defines a standard data cell.

A simple structure involves opening a <table>, creating <tr> elements for rows, and then placing <th> or <td> inside those rows. Tables are essential for displaying structured information like schedules, financial reports, or comparative data.

4. Explain the concept of Hyperlinks and Anchors in HTML. [5 Marks]

Answer: Hyperlinks are the backbone of the web, allowing users to move between different pages or resources.

Technical Explanation

  • Anchor Tag (<a>): The primary element used to define a link.
  • Href Attribute: This specifies the destination URL, which can be an external website, an internal page, or even a specific section of the same page.
  • Target Attribute: Often used to open links in a new browser window or tab using the value '_blank'.
  • Content: The text or image placed between <a> and </a> becomes the clickable element.

By effectively using anchors, developers create navigable, interconnected networks of information that provide a seamless user experience across the internet.

5. Discuss the role of CSS in enhancing HTML web pages. [5 Marks]

Answer: While HTML provides the content and structure, CSS (Cascading Style Sheets) provides the visual style and layout.

Key Functions

  • Separation of Concerns: Keeping layout code separate from structure leads to cleaner, more maintainable code.
  • Global Control: Changes made in a linked stylesheet can affect multiple pages simultaneously.
  • Styling Options: CSS allows for the manipulation of colors, fonts, margins, padding, and positioning that HTML tags alone cannot effectively handle.
  • Responsive Design: CSS media queries allow websites to adapt to different screen sizes, from mobile phones to desktop monitors.

Using CSS is a best practice in modern web development to create professional, aesthetically pleasing, and responsive user interfaces.


xxx

Did this help you understand better?

Your feedback improves the quality of this resource for everyone.