Home >Web Front-end >CSS Tutorial >Why Doesn't Margin Top Work on Inline Elements in Firefox?
Margin Top in Inline Elements: Firefox Behavior Explained
Questions often arise regarding the seemingly ignored margin top property for inline elements in Firefox. This behavior is not browser-specific but is defined in the CSS 2.1 Specification.
Section 8.3 of the specification states that margin properties apply to all elements. However, it also explicitly states that vertical margins (including margin-top) have no effect on non-replaced inline elements.
Therefore, it is expected behavior in Firefox and all other browsers compliant with the CSS specifications.
The above is the detailed content of Why Doesn't Margin Top Work on Inline Elements in Firefox?. For more information, please follow other related articles on the PHP Chinese website!