Which of the following are examples of void (empty) elements in HTML?
a) <br>, <hr>, <img>, <meta> b) <div>, <p>, <span>, <section> c) <a>, <ul>, <ol>, <li> d) <table>, <tr>, <td>, <th>
Correct Answer: a) <br>, <hr>, <img>, <meta>
Explanation: Void elements, such as <br> and <img>, do not require closing tags.
Question 42
Which of the following defines the minimal parts of an HTML document according to the HTML Living Standard?
a) <!DOCTYPE html>, <html>, <head>, <meta>, <title>, <body> b) <html>, <head>, <title>, <body>, <p>, <footer> c) <html>, <body>, <meta>, <footer>, <div> d) <!DOCTYPE html>, <head>, <footer>, <title>, <section>
Correct Answer: a) <!DOCTYPE html>, <html>, <head>, <meta>, <title>, <body>
Explanation: These are the minimal components required for a valid HTML document.
Question 43
True or False: To see how a webpage is constructed, a user can view the page source in the browser.
a) True b) False
Correct Answer: a) True
Explanation: Most browsers allow users to view the HTML source of a webpage through the "View Page Source" or "Inspect" options.
Question 44
What is a deprecated feature in web development?
a) A new and improved feature b) A part of a language officially discouraged because better features exist c) A hidden feature used only by browsers d) A feature that requires external plugins
Correct Answer: b) A part of a language officially discouraged because better features exist
Explanation: Deprecated features are discouraged for use because more modern alternatives are available.
Question 45
True or False: Whitespace is an unprinted character such as the spaces between words and lines of text.
a) True b) False
Correct Answer: a) True
Explanation: Whitespace refers to unprinted characters like spaces, tabs, and new lines in the document.
Question 46
True or False: Good practice is to use the <br> element to add space or control formatting of a webpage.
a) True b) False
Correct Answer: b) False
Explanation: The <br> element should only be used for line breaks. CSS should be used to control spacing and formatting.
Question 47
True or False: The <br> tag has a closing tag.
a) True b) False
Correct Answer: b) False
Explanation: The <br> tag is a self-closing or void element and does not require a closing tag
Question 48
How many heading element tags are there in HTML?
a) 4 b) 6 c) 7 d) 5
Correct Answer: b) 6
Explanation: HTML has six heading elements: <h1> to <h6>.
Question 49
Which HTML element should be nested within an <ul> or <ol> element for each list item?
a) <li> b) <dt> c) <dd> d) <p>
Correct Answer: a) <li>
Explanation: The <li> tag is used to define list items in both ordered and unordered lists.
Question 50
True or False: An ordered list (<ol>) should be used for a bulleted list of items.
a) True b) False
Correct Answer: b) False
Explanation: An ordered list (<ol>) creates a numbered list, while a bulleted list is created with an unordered list (<ul>).