property-value

display/inline-block — CSS reference

An atomic inline-level block container. It fits within a line as one unit and establishes a BFC for its children. Unlike ordinary inline text boxes, it accepts width and height.

Formal Syntax & Structure

css syntaxcss
display: inline-block; /* inline flow-root */

Working Example

Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>CSS flow layout lab</title><style>body {margin:0} .sample {background:#dcebe9;color:#182e32}body{font:16px/20px sans-serif} #p{width:240px;background:#e6eef2} .tile{background:#c2e4d5} #a,#b{box-sizing:content-box}#a,#b{display:inline-block;vertical-align:top}#a,#b{width:70px;height:30px}</style><body><div id="p"><span class="tile" id="a">First</span><span class="tile" id="b">Second</span></div></body></html>
CSS Reference