Skip to content

Commit ab05178

Browse files
kannanwisengithub-actions[bot]Josh-Cena
authored
[CSS] docs: Correct display value and BFC behavior for button elements (#40525)
* Update index.md * Update files/en-us/web/css/css_display/block_formatting_context/index.md Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Merge items * Reorder --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
1 parent add7aeb commit ab05178

File tree

1 file changed

+3
-6
lines changed
  • files/en-us/web/css/guides/display/block_formatting_context

1 file changed

+3
-6
lines changed

files/en-us/web/css/guides/display/block_formatting_context/index.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,15 @@ A block formatting context is created by at least one of the following:
1313
- The root element of the document (`<html>`).
1414
- Floats (elements where {{ cssxref("float") }} isn't `none`).
1515
- Absolutely positioned elements (elements where {{ cssxref("position") }} is `absolute` or `fixed`).
16-
- Inline-blocks (elements with {{cssxref("display", "display: inline-block")}}).
16+
- Inline-blocks (elements with {{cssxref("display", "display: inline-block")}}). This is the default display type for {{htmlelement("button")}} and button {{htmlelement("input")}} elements.
1717
- Table cells (elements with {{cssxref("display", "display: table-cell")}}, which is the default for HTML table cells).
1818
- Table captions (elements with {{cssxref("display", "display: table-caption")}}, which is the default for HTML table captions).
1919
- Anonymous table cells implicitly created by the elements with {{cssxref("display", "display: table")}}, `table-row`, `table-row-group`, `table-header-group`, `table-footer-group` (which is the default for HTML tables, table rows, table bodies, table headers, and table footers, respectively), or `inline-table`.
20-
- Block elements where {{ cssxref("overflow") }} has a value other than `visible` and `clip`.
2120
- Elements with {{cssxref("display", "display: flow-root")}}.
22-
- {{htmlelement("button")}} elements and button {{htmlelement("input")}} types defaulting to `display: flow-root`.
23-
- Elements with {{cssxref("contain", "contain: layout")}}, `content`, or `paint`.
2421
- Flex items (direct children of the element with {{cssxref("display", "display: flex")}} or `inline-flex`) if they are neither [flex](/en-US/docs/Glossary/Flex_Container) nor [grid](/en-US/docs/Glossary/Grid_Container) nor [table](/en-US/docs/Web/CSS/Guides/Table) containers themselves.
2522
- Grid items (direct children of the element with {{cssxref("display", "display: grid")}} or `inline-grid`) if they are neither [flex](/en-US/docs/Glossary/Flex_Container) nor [grid](/en-US/docs/Glossary/Grid_Container) nor [table](/en-US/docs/Web/CSS/Guides/Table) containers themselves.
23+
- Block elements where {{ cssxref("overflow") }} has a value other than `visible` and `clip`.
24+
- Elements with {{cssxref("contain", "contain: layout")}}, `content`, or `paint`.
2625
- Multicol containers (elements where {{ cssxref("column-count") }} or {{ cssxref("column-width") }} isn't `auto`, including elements with `column-count: 1`).
2726
- {{cssxref("column-span", "column-span: all")}}, even when the `column-span: all` element isn't contained by a multicol container.
2827

@@ -56,8 +55,6 @@ With `display: flow-root;` on the `<div>`, everything inside that container part
5655

5756
The value name of `flow-root` makes sense when you understand you are creating something that acts like the `root` element (`<html>` element in browser) in terms of how it creates a new context for the flow layout inside it.
5857

59-
This is the default rendering for {{htmlelement("button")}} elements and button {{htmlelement("input")}} types meaning button's create a new BFC as long as their `display` value isn't set to a value that doesn't automatically create a new BFC.
60-
6158
#### HTML
6259

6360
```html

0 commit comments

Comments
 (0)