Inline elements typically do not have a set width or height, instead conforming to the surrounding elements in an inline manner. They only take up space within the tags that enclose them. For instance:
This is some <span>text</span>
<span>text</span>
occupies only the space necessary for the word "text". It flows in line with other text nodes in the HTML document.
The property known as float
brings about block-level display behavior by changing the display
attribute of elements to block (in most scenarios), enabling explicit setting of width and height since they consume all available space within their container. As stated on MDN:
Since float
imposes block layout attributes, it alters the computed value of display
properties in certain cases.
According to the reference material provided on MDN, elements styled with display: table-row
will transform into block-level components with display: block
when floated.