π Teacher Answer Key
HTML Unit 2 Review
π Multiple Choice Answers
1. When a web browser displays a web page, it reads from what type of file?
β B. Plain text file
Explanation: HTML files are plain text files that can be opened with any text editor. Browsers parse these text files and render them visually. This is why you can view the source code of any webpage.
2. What are the two distinct parts of an HTML document?
β B. Head and body
Explanation: Every HTML document is divided into two main sections: the <head> (containing metadata, title, and links to resources) and the <body> (containing all visible content). This structure is fundamental to HTML.
3. Which tag is used to create the largest heading in HTML?
β B. <h1>
Explanation: HTML headings range from <h1> (largest/most important) to <h6> (smallest). <h1> should typically be used once per page for the main heading. The <title> tag defines the browser tab title, not a visible heading.
4. If a browser encounters an HTML tag it doesn't recognize, what will it do?
β C. Ignore it
Explanation: Browsers are designed to be forgiving. When they encounter unrecognized tags, they simply ignore them and continue rendering the rest of the page. This helps maintain backward compatibility and prevents pages from breaking due to typos or unsupported tags.
βοΈ Fill in the Blank Answers
5. HTML tags are marked by the < (less than) and > (greater than) signs.
Explanation: Also called angle brackets, these characters define the beginning and end of HTML tags. Accept "angle brackets" or "less than/greater than signs."
6. In HTML, the ending tag contains the / (forward slash) character.
Explanation: The forward slash distinguishes closing tags from opening tags (e.g., <p> opens, </p> closes). This tells the browser where an element ends.
7. The <head> section of an HTML document contains information about the document that is not displayed on the screen.
Explanation: The head section includes metadata, title, links to CSS/JavaScript, character encoding, and other information for browsers and search engines but not directly visible to users.
8. The <body> section contains everything that is displayed as part of the web page.
Explanation: All visible contentβtext, images, videos, links, etc.βgoes inside the body section. This is what users actually see when they visit the webpage.
9. Comment tags in HTML are enclosed by <!-- and -->.
Explanation: Comments help developers document their code. Text between <!-- and --> is completely ignored by the browser and won't appear on the page.
10. All HTML content should be enclosed within <html> tags.
Explanation: The <html> tag is the root element that wraps all other HTML content. It tells the browser that this document contains HTML code.
11. To make text bold in HTML, you use the <b> or <strong> tags.
Explanation: Both tags make text bold, but <strong> also indicates semantic importance (preferred for accessibility), while <b> is purely visual formatting.
12. To make text italic in HTML, you use the <i> or <em> tags.
Explanation: Similar to bold tags, <em> (emphasis) adds semantic meaning while <i> (italic) is purely stylistic. Modern best practice favors <em> for emphasized text.
β True or False Answers
13. The comment text following a comment tag can span more than one line.
β TRUE
Explanation: Comments can be as long as needed and span multiple lines. This is useful for longer explanations or temporarily disabling large blocks of code.
14. HTML tags should always be written in upper-case letters.
β FALSE
Explanation: HTML is case-insensitive, but lowercase is the modern standard and best practice. Older HTML versions used uppercase, but HTML5 recommends lowercase for consistency and readability.
15. If you forget an ending tag in HTML, the browser will crash.
β FALSE
Explanation: Browsers are robust and forgiving. A missing closing tag won't crash the browser, but it may cause display issues like formatting extending beyond intended boundaries. The browser will attempt to render the page anyway.
16. The <title> tag is located inside the <body> section.
β FALSE
Explanation: The <title> tag belongs in the <head> section. It defines the text shown in the browser tab/window title bar, not visible content on the page itself.
17. HTML files can have either a .htm or .html file extension.
β TRUE
Explanation: Both extensions are valid. .htm was used in older systems with 3-character extension limits. Modern practice prefers .html, but browsers accept both.
18. The <br> tag requires a closing tag.
β FALSE
Explanation: <br> is a self-closing (void) tag that creates a line break. It doesn't have content, so it doesn't need a closing tag. Some write it as <br/> but <br> is sufficient in HTML5.
π Short Answer Suggested Responses
19. Explain in detail what might happen with a web page if you forget to include an ending tag for a piece of text.
Sample Answer:
If you forget an ending tag, the formatting from that tag will continue beyond where you intended it to stop. For example, if you forget </strong> after making one word bold, all the text after it will also be bold until the browser encounters another closing tag or the end of the document. This can make your webpage look messy and unprofessional. The browser won't crash, but the page won't display correctly. It might also affect the layout of other elements on the page.
Grading Notes: Look for understanding that: (1) formatting continues past intended point, (2) browser doesn't crash but display is affected, (3) specific example provided. Award full credit for responses demonstrating these concepts even if wording differs.
20. Briefly explain what the <title>...</title> tags do, and where they are located.
Sample Answer:
The <title> tag defines the title of the webpage that appears in the browser tab or window title bar. It's located in the <head> section of the HTML document, not in the <body>. The title is important for bookmarks and search engine results, but users don't see it on the actual webpage itselfβonly in the tab or window title.
Grading Notes: Look for: (1) understanding title appears in browser tab/window, (2) located in head section, (3) not visible on the page itself. Bonus: mention of SEO or bookmarks.
π‘ Discussion Questions for Debrief:
- Why do you think browsers are designed to be so forgiving with errors?
- What's the advantage of separating head and body sections?
- When would you use <strong> vs <b>? Does semantic meaning matter?
- Can anyone share a time when they forgot a closing tag? What happened?
- How do comments help you as a developer?