Skip to content

Commit

Permalink
missed an IE mention / centering using margin (#34174)
Browse files Browse the repository at this point in the history
* missed an IE mention

* Update files/en-us/web/css/margin/index.md
  • Loading branch information
estelle authored Jun 20, 2024
1 parent b118a17 commit 7016e37
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions files/en-us/web/css/margin/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ The top and bottom margins have no effect on _non-[replaced](/en-US/docs/Web/CSS

### Horizontal centering

To center something horizontally in modern browsers, you can use {{cssxref("display")}}`: flex;` {{cssxref("justify-content")}}`: center;`.
You can horizontally center an element within its parent by setting `margin: 0 auto;`.

However, in older browsers like IE8-9 that do not support Flexible Box Layout, these are not available. In order to center an element inside its parent, use `margin: 0 auto;`.
A more common method to center an element horizontally is by setting `display: flex;` and [`justify-content: center;`](/en-US/docs/Web/CSS/justify-content) on a container, which [centers its flex item](/en-US/docs/Web/CSS/CSS_flexible_box_layout/Aligning_items_in_a_flex_container) children.

### Margin collapsing

Expand Down

0 comments on commit 7016e37

Please sign in to comment.