HTML Lists Interview
Interview questions on unordered, ordered, and description lists with practical usage.
1Difference between
ul and ol?easyAnswer:
ul is unordered (bullet list), ol is ordered (numbered sequence).2When to use description list?easy
Answer: Use
dl, dt, dd for term-definition pairs or label-value content.3Can lists be nested?easy
Answer: Yes, place a child list inside a parent
li.4How to start ordered list at a custom number?medium
Answer: Use
<ol start="5">.5How to reverse ordered list numbering?medium
Answer: Use
<ol reversed>.6What does list semantics help with?medium
Answer: Accessibility, screen reader understanding, and clearer content structure.
7Why avoid using list tags for layout?medium
Answer: It breaks semantic meaning and harms maintainability.
8How to style bullets/numbers?easy
Answer: With CSS properties like
list-style-type and list-style-position.9Can one list item contain complex content?easy
Answer: Yes, each
li can include text, links, images, and nested blocks.10Best practice answer in interviews?medium
Answer: Pick list type by meaning: sequence ->
ol, group -> ul, term/value -> dl.