Skip to content
HTML·Intermediate·Conceptual·1 min read

When should section be used instead of div?

Short interview answer

Use section for a thematic grouping that belongs in the document outline and normally has a heading. Use div when no semantic element describes the grouping.

Key takeaway

Explain the underlying mental model clearly, then support it with a concrete example and its trade-offs.

← Back to Semantic HTML

Related questions