CIW Advanced HTML5 & CSS3 Specialist 1 — Questions and Answers
Question 1: Which HTML5 element is used to define a block of navigation links?
- <nav> (Correct answer)
- <section>
- <header>
- <aside>
Correct answer: <nav>
The <nav> element is the semantic HTML5 element specifically intended to contain a set of navigation links.
Question 2: What is the correct HTML5 doctype declaration?
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 5.0//EN">
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE html> (Correct answer)
- <html version="5">
Correct answer: <!DOCTYPE html>
<!DOCTYPE html> is the simplified HTML5 doctype that instructs browsers to render the page in standards mode.
Question 3: Which HTML5 input type provides built-in validation for email address format?
- type="text"
- type="mail"
- type="address"
- type="email" (Correct answer)
Correct answer: type="email"
type="email" instructs the browser to validate that the entered value matches an email address format before form submission.
Question 4: Which HTML5 element represents a self-contained composition that could be independently distributed, such as a blog post?
- <section>
- <article> (Correct answer)
- <aside>
- <main>
Correct answer: <article>
The <article> element represents content that is self-contained and could stand alone, such as a news article, blog post, or forum entry.
Question 5: What HTML5 form attribute forces the user to fill in a field before the form can be submitted?
- mandatory
- notnull
- required (Correct answer)
- validate
Correct answer: required
The 'required' attribute triggers native browser-side validation, preventing form submission if the field is empty.
Question 6: Which HTML5 element is used to define the main content area of a document, excluding headers, footers, and navigation?
- <content>
- <body>
- <article>
- <main> (Correct answer)
Correct answer: <main>
The <main> element identifies the dominant content of the document body and should appear only once per page.
Question 7: Which HTML5 element is used to draw raster graphics dynamically via JavaScript?
- <svg>
- <draw>
- <canvas> (Correct answer)
- <graphics>
Correct answer: <canvas>
The <canvas> element provides a resolution-dependent bitmap area that JavaScript can use to render 2D graphics, charts, and animations.
Which HTML5 element is used to define a block of navigation links?