Alex Rivera | Logout

Is there a native inline-block HTML 'container' element?

Asked 2012-01-09T14:21:20.373
24

A span is an inline element and div is a block element. Is there a 'native' (X)HTML / HTML5 inline-block element that can act like a container? (Without applying CSS)

Definitions:

block
This value causes an element to generate a block box.
inline-block
This value causes an element to generate an inline-level block container. The inside of an inline-block is formatted as a block box, and the element itself is formatted as an atomic inline-level box.
inline
This value causes an element to generate one or more inline boxes.

Edit
Report

1 Answer

11

Strictly speaking <button> fulfils the criteria set. HTML5 says

When the button binding applies to a button element [which it ordinarily does], the element is expected to render as an 'inline-block' box rendered as a button whose contents are the contents of the element.

However while it is a container element that has a default inline-block rendering, it is not a General Purpose container so can't be used for anything but as a button.

answered 2012-01-09T16:57:30.903

Your Answer