Floating Inline Elements and the Inline Box Model

0

Posted by admin | Posted in Uncategorized | Posted on 04-07-2009

Tags: , , ,

The final rule for floated elements is that they’re always treated like block elements. Inline elements like <span> or <em> allow some box model properties such as margin, borders, and padding to be applied. Inline elements, however, do not allow dimensional properties such as width and height to be applied. This is understandable because these properties are expected to be contained in the flow of text. The <img/> element is an exception because it allows dimensional properties to be applied. Elements like the <img/> element are known as replaced inline elements, and elements like <span> and <em> are known as non-replaced inline elements. Replaced inline elements are replaced by something—for example the <img/> element is replaced by the image referenced via the src attribute. After the float property is applied to an element, it doesn’t matter if the original element was an inline element or a replaced inline element because a floated element is a block element.

Comments are closed.