Bird
Raised Fist0
HTMLmarkup~10 mins

Description lists in HTML - Interactive Code Practice

Choose your learning style10 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to start a description list.

HTML
<[1]>
  <dt>HTML</dt>
  <dd>HyperText Markup Language</dd>
</[1]>
Drag options to blanks, or click blank then click option'
Aul
Bdl
Col
Ddiv
Attempts:
3 left
💡 Hint
Common Mistakes
Using
    or
      instead of
      for description lists.
Using
which is a generic container.
2fill in blank
medium

Complete the code to add a term in a description list.

HTML
<dl>
  <[1]>CSS</[1]>
  <dd>Cascading Style Sheets</dd>
</dl>
Drag options to blanks, or click blank then click option'
Adt
Bdd
Cli
Dp
Attempts:
3 left
💡 Hint
Common Mistakes
Using
instead of
for terms.
Using list item tags
  • inside description lists.
  • 3fill in blank
    hard

    Fix the error in the description list code by choosing the correct tag for the description.

    HTML
    <dl>
      <dt>JavaScript</dt>
      <[1]>Programming language for the web</[1]>
    </dl>
    Drag options to blanks, or click blank then click option'
    Adt
    Bp
    Cli
    Ddd
    Attempts:
    3 left
    💡 Hint
    Common Mistakes
    Using
    for descriptions instead of
    .
    Using list item tags
  • inside description lists.
  • 4fill in blank
    hard

    Fill both blanks to create a description list with a term and its description.

    HTML
    <[1]>
      <[2]>API</[2]>
      <dd>Application Programming Interface</dd>
    </[1]>
    Drag options to blanks, or click blank then click option'
    Adl
    Bdd
    Cdt
    Dul
    Attempts:
    3 left
    💡 Hint
    Common Mistakes
    Using
      instead of
      for the list.
    Using
    instead of
    for the term.
    5fill in blank
    hard

    Fill all three blanks to create a description list with two terms and their descriptions.

    HTML
    <[1]>
      <dt>HTTP</dt>
      <[2]>HyperText Transfer Protocol</[2]>
      <dt>URL</dt>
      <[3]>Uniform Resource Locator</[3]>
    </[1]>
    Drag options to blanks, or click blank then click option'
    Adl
    Bdd
    Dul
    Attempts:
    3 left
    💡 Hint
    Common Mistakes
    Using
      instead of
      for the list.
    Using
    instead of
    for descriptions.

    Practice

    (1/5)
    1. What is the main purpose of the <dl> element in HTML?
    easy
    A. To add a paragraph of text
    B. To create a numbered list of items
    C. To create a table with rows and columns
    D. To create a description list that pairs terms with their descriptions

    Solution

    1. Step 1: Understand the role of <dl>

      The <dl> tag is used to group terms and their descriptions in a list format.
    2. Step 2: Compare with other list types

      Unlike ordered (<ol>) or unordered (<ul>) lists, <dl> is specifically for description lists.
    3. Final Answer:

      To create a description list that pairs terms with their descriptions -> Option D
    4. Quick Check:

      Description list = <dl> [OK]
    Hint: Remember: dl = description list, dt = term, dd = description [OK]
    Common Mistakes:
    • Confusing <dl> with <ul> or <ol>
    • Thinking <dl> creates tables
    • Using <dl> for paragraphs
    2. Which of the following is the correct syntax to start a description list in HTML?
    easy
    A. <dl>
    B. <dt>
    C. <dd>
    D. <list>

    Solution

    1. Step 1: Identify the container tag for description lists

      The <dl> tag is the container that starts a description list.
    2. Step 2: Understand roles of <dt> and <dd>

      <dt> defines a term, and <dd> defines its description, but they do not start the list.
    3. Final Answer:

      <dl> -> Option A
    4. Quick Check:

      Start description list = <dl> [OK]
    Hint: Description lists always start with <dl> tag [OK]
    Common Mistakes:
    • Using <dt> or <dd> as the list container
    • Using non-existent <list> tag
    • Confusing with unordered list tags
    3. What will the following HTML code display in a browser?
    <dl>
      <dt>HTML</dt>
      <dd>HyperText Markup Language</dd>
      <dt>CSS</dt>
      <dd>Cascading Style Sheets</dd>
    </dl>
    medium
    A. A numbered list with descriptions
    B. A bulleted list with HTML and CSS as items
    C. A list showing 'HTML' with 'HyperText Markup Language' below it, then 'CSS' with 'Cascading Style Sheets' below it
    D. Plain text without any list formatting

    Solution

    1. Step 1: Understand the structure of the description list

      The <dl> contains pairs of <dt> (terms) and <dd> (descriptions).
    2. Step 2: Visualize the browser rendering

      Each term appears on its own line, with its description indented below it, forming a clear term-description pair.
    3. Final Answer:

      A list showing 'HTML' with 'HyperText Markup Language' below it, then 'CSS' with 'Cascading Style Sheets' below it -> Option C
    4. Quick Check:

      dl shows terms with indented descriptions [OK]
    Hint: dt = term, dd = description shown indented below [OK]
    Common Mistakes:
    • Thinking it creates bulleted or numbered lists
    • Expecting terms and descriptions on the same line
    • Ignoring indentation of descriptions
    4. Identify the error in this description list code:
    <dl>
      <dt>JavaScript</dt>
      <dt>A programming language</dt>
    </dl>
    medium
    A. Missing closing </dl> tag
    B. Using two <dt> tags without a <dd> for description
    C. Using <dd> instead of <dt> for term
    D. No error, code is correct

    Solution

    1. Step 1: Check tag usage in description lists

      <dt> is for terms, <dd> is for descriptions. Terms should be followed by descriptions.
    2. Step 2: Identify the problem in the code

      The code uses two <dt> tags in a row without a <dd> describing the first term.
    3. Final Answer:

      Using two <dt> tags without a <dd> for description -> Option B
    4. Quick Check:

      Term must have description after it [OK]
    Hint: Each <dt> term needs a following <dd> description [OK]
    Common Mistakes:
    • Using multiple <dt> tags without <dd>
    • Confusing <dt> and <dd> roles
    • Forgetting to close <dl>
    5. You want to create a description list where some terms have multiple descriptions. Which is the correct way to write it?
    hard
    A.
    Fruit
    Apple
    Banana
    Vegetable
    Carrot
    B.
    Fruit
    Apple
    Banana
    Vegetable
    Carrot
    C.
    Fruit
    Apple
    Banana
    Vegetable
    Carrot
    D.
    Fruit
    Apple
    Banana
    Vegetable
    Carrot

    Solution

    1. Step 1: Understand multiple descriptions for one term

      A term (<dt>) can have multiple descriptions (<dd>) listed below it.
    2. Step 2: Analyze each option's structure

      Fruit
      Apple
      Banana
      Vegetable
      Carrot
      correctly groups multiple <dd> tags under one <dt> term. Other options misuse tags or mix terms and descriptions incorrectly.
    3. Final Answer:

      Option A shows correct multiple descriptions for one term -> Option A
    4. Quick Check:

      Multiple
      under one
      is valid [OK]
    Hint: Use multiple <dd> tags after one <dt> for several descriptions [OK]
    Common Mistakes:
    • Using multiple <dt> tags for descriptions
    • Placing <dd> before <dt>
    • Using only <dd> without <dt>
    Recommended

    Ready to prove it?

    Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

    10 questions~5 mineasy hard