twitter/bootstrap — Issue #921: Invalid use of <legend> in 2.0 form docs
Author: acoulton
Created: 2012-01-07 22:11:16+00:00
State: open

In the docs for 2.0-wip, the form examples show HTML like this:

~~~

Example form section

Text input

~~~

However, this is invalid HTML as the
tag cannot appear as a child of

- in HTML4 it should be within a

while in HTML5 it also applies to

and

.

It is valid to nest

elements, so it would be possible to add a simple

as the first child of

in the example above to make the markup valid. This also has the advantage of restoring the semantic meaning of fieldset as a way of grouping multiple inputs together.

However, with the current styles doing so causes the vertical margin between the
and the first control group to collapse in Chrome.