Search code examples
htmlmarkupsemantics

Is it correct to nest HTML definition lists (<dl>)?


Is it semantically correct to nest definition lists, or should they simply be a 'flat list of name/value pairs'.

The specs don't seem to forbid it.

Further to this question.


Solution

  • Well the spec seems to allow it, provided that only the <dd> contains nested lists. The spec states that a <dt> is an inline element, so it can't contain a nested list. A <dd> is a block element, so an inner list inside one of these is fine.