Introduction

An element’s containing block is its nearest block-level parent element. For example, if you include an li tag within a ul tag, the li’s containing block is defined by the ul tag.

A floated element generates a block box, regardless of the kind of element that is being floated. For instance, floating an anchor tag (<a>) whose containing block is a paragraph (<p>) generates a block box encasing the former in the latter.

Lastly, the following nine rules, published by the W3C in the “Visual formatting model” section of the Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification, only apply to top, right, and left edges of floated elements.