Inline elements by definition do not take explicit width or height but are inline and conform to the surrounding elements. They only occupy space bounded by the tags. For example:
This is some <span>text</span>
<span>text</span>
only occupies the space that houses text
. It's in the same line with the other text nodes in the HTML.
The float
property implies block layout and the display
property of elements is changed to block (in most cases) thus making them block-level elements where you can set explicit width and height because they occupy all of their container. Per the MDN documentation:
As float
implies the use of the block layout, it modifies the computed value of the display
values, in some cases
In this case, the table (viewable at the MDN documentation) shows that any elements with display: table-row
would blockified and have display: block
when floated.