From 3a69b74048ff2480c481ace3e689fbb4d510f3e5 Mon Sep 17 00:00:00 2001 From: volfmaty Date: Sat, 24 Jan 2026 16:43:05 +0100 Subject: [PATCH] Fix `display` toggle in playground not changing value (#42437) * Fix display toggle in playground not changing value The [`display: flow-root` playground](https://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Display/Multi-keyword_syntax#display_block_flow-root_and_display_inline_flow-root) has a `` element to see the effect of differ You can use any value with `flow-root` to create a new formatting context for the parent, making the child element margin relative to its parent's outer edge and avoiding the margin collapse. Changing between `display: flow-root` and `display: block flow-root` will achieve the same effect as the single-value `flow-root` keyword. -```js hidden +```js hidden live-sample___flow-root const parentDiv = document.getElementById("parent"); const siblingDiv = document.getElementById("sibling"); const displayTypeSelect = document.getElementById("displayType"); @@ -170,7 +170,7 @@ function changeDisplayType() { displayTypeSelect.addEventListener("change", changeDisplayType); ``` -```css hidden +```css hidden live-sample___flow-root #controls { padding: 1rem; outline: 2px dashed black; @@ -181,7 +181,7 @@ body { } ``` -```css +```css live-sample___flow-root div, p { outline: 2px solid black; @@ -205,7 +205,7 @@ p { } ``` -```html hidden +```html hidden live-sample___flow-root