0
0
HTMLmarkup~20 mins

Description lists in HTML - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Description List Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
rendering
intermediate
2:00remaining
What is the visual output of this description list?
Look at the HTML code below. What will the browser show visually?
HTML
<dl>
  <dt>HTML</dt>
  <dd>HyperText Markup Language</dd>
  <dt>CSS</dt>
  <dd>Cascading Style Sheets</dd>
</dl>
AA list with bold terms 'HTML' and 'CSS' each followed by their descriptions indented below.
BA bulleted list with items 'HTML' and 'CSS' only.
CA numbered list with 'HTML' and 'CSS' as items.
DPlain text with no special formatting or indentation.
Attempts:
2 left
💡 Hint
Description lists show terms and their descriptions with indentation.
📝 Syntax
intermediate
2:00remaining
Which option fixes the invalid description list syntax?
This code has a mistake. Which option corrects it so the description list is valid?
HTML
<dl>
  <dt>JavaScript
  <dd>A programming language
  <dt>Python</dt>
  <dd>A scripting language</dd>
</dl>
A
&lt;dl&gt;
  &lt;dt&gt;JavaScript&lt;/dt&gt;
  &lt;dd&gt;A programming language&lt;/dd&gt;
  &lt;dt&gt;Python&lt;/dt&gt;
  &lt;dd&gt;A scripting language&lt;/dd&gt;
&lt;/dl&gt;
B
&lt;dl&gt;
  &lt;dt&gt;JavaScript&lt;/dt&gt;
  &lt;dd&gt;A programming language&lt;/dd&gt;
  &lt;dd&gt;Python&lt;/dd&gt;
  &lt;dd&gt;A scripting language&lt;/dd&gt;
&lt;/dl&gt;
C
&lt;dl&gt;
  &lt;dt&gt;JavaScript
  &lt;dd&gt;A programming language&lt;/dd&gt;
  &lt;dt&gt;Python&lt;/dt&gt;
  &lt;dd&gt;A scripting language&lt;/dd&gt;
&lt;/dl&gt;
D
&lt;dl&gt;
  &lt;dt&gt;JavaScript&lt;/dt&gt;
  &lt;dd&gt;A programming language
  &lt;dt&gt;Python&lt;/dt&gt;
  &lt;dd&gt;A scripting language&lt;/dd&gt;
&lt;/dl&gt;
Attempts:
2 left
💡 Hint
Each
and
must be properly closed with matching tags.
selector
advanced
2:00remaining
Which CSS selector targets only the description terms in a description list?
You want to style only the terms (not descriptions) inside a
. Which CSS selector should you use?
Adl dt dd
Bdl > dt
Cdl > dd
Ddl dt + dd
Attempts:
2 left
💡 Hint
Terms are inside
tags directly under
.
layout
advanced
2:00remaining
How to align description terms and descriptions side by side?
You want the terms on the left and their descriptions on the right in one row each. Which CSS layout approach works best?
AUse display:inline on both <dt> and <dd>.
BUse float:left on <dt> and float:right on <dd>.
CUse CSS Grid on <dl> with two columns: one for <dt>, one for <dd>.
DUse position:absolute on <dt> and relative on <dd>.
Attempts:
2 left
💡 Hint
Modern CSS layout methods like Grid help align items in columns.
accessibility
expert
2:00remaining
What is the best ARIA role to improve accessibility for a description list?
To help screen readers understand a description list, which ARIA role should you add to the
element?
Arole="list"
Brole="listitem"
Crole="definition"
Drole="list" is not recommended; use native <dl> without ARIA roles.
Attempts:
2 left
💡 Hint
Native HTML elements often have built-in accessibility.