Skip to content

Clarification: can divs inside dls contain elements other than dt/dd? #12045

@BrendanBerkley

Description

@BrendanBerkley

What is the issue with the HTML Standard?

I'm trying to understand the relationship between two parts of the spec regarding dl and div.

The div element section states:

One or more dt elements followed by one or more dd elements, optionally intermixed with script-supporting elements.

However, when you get to dl it says:

ignoring any nodes other than dt and dd element children, and dt and dd elements that are children of div element children.

Is the "ignoring any nodes" language purely about the algorithm for semantic interpretation, while the content model strictly prohibits other elements? Or does the "ignoring" language imply that other elements may be present (and are simply ignored for semantic purposes)?

Specifically, is this valid?

<dl>
  <div>
    <dt>Term</dt>
    <div>
      <dd>Description</dd>
      <dd>Another description</dd>
    </div>
  </div>
</dl>

Feels like it should be valid, but axe is currently saying it isn't, and I thought the spec was unclear enough to ask.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions