Which attribute within the viewport meta tag is used to set the initial zoom level of the webpage?
Explanation:
The 'initial-scale' attribute specifies the initial zoom level when the page is first loaded on the device. It controls how zoomed-in or zoomed-out the content appears initially.
How does the <kbd>
tag differ from the <code>
tag in HTML?
Explanation:
While both tags can visually format text similarly, their semantic meanings are distinct. Use <kbd>
to represent keys pressed by a user, and use <code>
for snippets of program code.
What is the primary purpose of Web Workers in HTML5?
Explanation:
Web Workers allow you to run JavaScript code in a separate thread, preventing long-running scripts from blocking the main user interface thread and improving responsiveness.
Which HTML5 element is used to define the main content of a webpage?
Explanation:
The <main> element is specifically designed to represent the dominant content within the body of an HTML document. It's intended to enclose the content that's directly related to the central topic of the page.
Which attribute, when added to an input field, makes it mandatory for the user to fill out before submitting the form?
Explanation:
The 'required' attribute, when present within an input tag, enforces the user to provide a value for that specific field before the form can be successfully submitted.
What is the primary purpose of the <pre>
tag in HTML?
Explanation:
The <pre>
tag defines preformatted text. Any whitespace characters like spaces and line breaks within the <pre>
element are displayed exactly as they are typed in the HTML source code.
Which HTML element is used to indicate a lengthy quotation from another source?
Explanation:
The <blockquote>
tag is specifically designed for long quotations. Browsers often indent content within <blockquote>
tags to visually set them apart from surrounding text.
What HTML5 tag provides a predefined list of options for an input field, offering suggestions to the user as they type?
Explanation:
The 'datalist' element is used to create a list of suggestions for input fields. It's linked to an input element, and options within the datalist appear as suggestions while the user types.
Which HTML tag is most appropriate for displaying a variable name within a code snippet?
Explanation:
The <var>
tag is specifically meant to represent a variable within programming code. While you could use <code>
for the entire code snippet, using <var>
for variables makes the code more readable and meaningful.
Which type of Web Storage is designed to store data for the duration of the user's browsing session?
Explanation:
Data stored in sessionStorage
persists only for the duration of the user's session in the browser. It is deleted when the user closes the tab or window.