Free Practice Quiz Question List

2 HTML Structure and Semantics Online Quiz Questions

Use this free practice quiz with 20 questions to review 2 HTML Structure and Semantics, test your knowledge, and prepare for your next test or exam.

20 questions
01
True or false
1 point

True or false: CSS can change how a semantic element looks without changing the meaning that the element conveys.

  1. A

    True

  2. B

    False

02
True or false
1 point

True or false: An <img> element must have a closing tag to be valid HTML.

  1. A

    True

  2. B

    False

03
Choose one
1 point

A page contains a self-contained item that could make sense on its own, such as an independent article. Which element is the best semantic fit?

  1. A

    <article>

  2. B

    <div>

  3. C

    <footer>

  4. D

    <nav>

04
Fill in the blank
1 point

In a typical HTML document, the contains document information, and the contains the page content.

05
Choose one
1 point

A control on a page performs an action rather than navigating to another destination. Which HTML element should you use?

  1. A

    <a>

  2. B

    <nav>

  3. C

    <button>

  4. D

    <section>

06
Fill in the blank
1 point

For a same-page link, the href value points to an element whose id value is .

07
Written response
1 point

What exact alt attribute and value should you use for a purely decorative image so assistive technology can skip it?

08
Choose one
1 point

A sentence is ordinary body text, but a designer wants it to look large. Which approach follows the guidance for headings?

  1. A

    Use a heading element because it is the quickest way to make ordinary text large.

  2. B

    Keep the text in an appropriate non-heading element and use CSS to style it.

  3. C

    Choose whichever heading level produces the preferred appearance.

  4. D

    Replace the text with a <div> and rely on its default size.

09
Choose all
1 point

Select all accurate statements about HTML document setup and metadata.

  1. A

    <!doctype html> tells browsers to use modern standards mode.

  2. B

    The document's character encoding can be specified in a meta element.

  3. C

    The document <title> is shown in the browser tab.

  4. D

    The <title> is the element intended to hold the visible page content.

10
Open ended
1 point

Explain what semantic HTML contributes to a page and why changing an element's appearance with CSS does not change its semantic meaning.

11
Choose all
1 point

Select all accurate practices for writing image alternatives.

  1. A

    For an informative image, provide alternative text conveying its relevant information or function.

  2. B

    For a purely decorative image, use an empty alternative value.

  3. C

    When an image is a link, make its alternative help communicate the link's purpose.

  4. D

    Repeat the adjacent caption word for word as the alternative text in every case.

12
Choose one
1 point

You are marking up a page region containing the site's main navigation links. Which semantic element best describes that region?

  1. A

    <footer>

  2. B

    <nav>

  3. C

    <article>

  4. D

    <section>

13
Choose one
1 point

A page links to a planting guide, a map, and an events calendar. Which link label best helps someone understand the destination even when the link is encountered outside its paragraph?

  1. A

    “Click here” for every destination

  2. B

    “Download the garden planting guide”

  3. C

    “More” for every destination

  4. D

    “Read this” for every destination

14
Choose one
1 point

A page has an h2 heading for “Plant care,” followed by a subsection about pruning. Which heading rank best represents the subsection in the content hierarchy?

  1. A

    Use an h1 because the text should stand out

  2. B

    Use an h2 because all section headings should have the same rank

  3. C

    Use an h3 because it is a subsection beneath an h2

  4. D

    Use whichever heading rank produces the desired font size

15
Choose one
1 point

A page uses CSS to position cards in a grid. What should the developer do in the HTML so that the cards also make sense when read without that visual layout?

  1. A

    Arrange the HTML so the content reads in a meaningful sequence before visual styling is applied

  2. B

    Put all interactive elements at the end of the HTML regardless of their context

  3. C

    Use CSS to make an arbitrary source sequence appear meaningful

  4. D

    Place headings after all the content they describe

16
Choose one
1 point

A developer is marking up a page with meaningful regions and also needs a wrapper that serves only as a styling hook. Which approach best follows the guidance for accessible markup?

  1. A

    Use div elements for every region and rely on their text to communicate purpose

  2. B

    Use appropriate semantic elements for meaningful regions and reserve div for generic grouping

  3. C

    Use headings in place of all structural elements

  4. D

    Use CSS class names as a substitute for meaningful HTML elements

17
True or false
1 point

True or false: Link text such as “View the garden hours” is generally more informative on its own than a repeated label such as “Click here.”

  1. A

    True

  2. B

    False

18
Written response
1 point

A page groups related information about visiting hours under its own heading. Which HTML element name best describes this content group?

19
Written response
1 point

A developer needs a generic wrapper only to apply a CSS layout rule; it does not represent a meaningful region or related content group. Enter the HTML element name that fits this purpose.

20
Written response
1 point

An anchor element should take a reader to a separate page. Which attribute specifies the link’s destination?