Skip to content

Commit d331e14

Browse files
Josh-Cenadipikabh
andcommitted
Apply suggestions from code review
Co-authored-by: Dipika Bhattacharya <[email protected]>
1 parent 6e97aa1 commit d331e14

File tree

1 file changed

+4
-4
lines changed
  • files/en-us/web/css/css_text/whitespace

1 file changed

+4
-4
lines changed

files/en-us/web/css/css_text/whitespace/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ In a nutshell, different whitespace characters are collapsed and transformed in
174174

175175
### Trimming and positioning
176176

177-
In both [inline](/en-US/docs/Web/CSS/CSS_inline_layout/Inline_formatting_context) and [block](/en-US/docs/Web/CSS/CSS_display/Block_formatting_context) formatting contexts, elements are laid out in _lines_. In an inline formatting, lines are created by text wrapping. In a block formatting context, on the other hand, each block forms its own line. As each line is laid out, whitespace is processed further. Let's take a look at an example to explain how this works.
177+
In both [inline](/en-US/docs/Web/CSS/CSS_inline_layout/Inline_formatting_context) and [block](/en-US/docs/Web/CSS/CSS_display/Block_formatting_context) formatting contexts, elements are laid out in _lines_. In an inline formatting context, lines are created by text wrapping. In a block formatting context, on the other hand, each block forms its own line. As each line is laid out, whitespace is processed further. Let's take a look at an example to explain how this works.
178178

179179
In this example, as before, we've marked the whitespace characters in a comment. We have three text nodes that contain only whitespace: one before the first `<div>`, one between the 2 `<div>`s, and one after the second `<div>`.
180180

@@ -268,7 +268,7 @@ Different {{cssxref("white-space-collapse")}} values skip different steps of thi
268268

269269
- `preserve` and `break-spaces`: The whole algorithm is skipped except for step 3, so no whitespace collapsing or transformation happens.
270270
- `preserve-spaces`: The whole algorithm is skipped, so whitespace characters at the start and end of lines are preserved.
271-
- `preserve-breaks`: the algorithm is the same as `collapse`.
271+
- `preserve-breaks`: The algorithm is the same as that of `collapse`.
272272

273273
## How do DOM APIs process whitespace?
274274

@@ -289,7 +289,7 @@ selection.selectAllChildren(div);
289289
console.log(selection.toString()); // "Hello world!"
290290
```
291291

292-
## Solving problems with whitespace nodes
292+
## Solving common problems with whitespace nodes
293293

294294
Whitespace nodes are invisible to the website visitor due to the CSS processing rules, but they can interfere with certain layouts and DOM manipulation that rely on the exact structure of the DOM. Let's look at some common problems and how to solve them.
295295

@@ -368,7 +368,7 @@ There are a few ways of getting around this problem:
368368
}
369369
```
370370

371-
- If you need to rely on `inline-block`, you could set the [`font-size`](/en-US/docs/Web/CSS/font-size) of the list to `0`. This only works if the blocks are not sized with `em` units (since `em` is based on the `font-size`, so the block size would also end up being sized as `0`). Using `rem` units would be a good choice here:
371+
- If you need to rely on `inline-block`, you could set the [`font-size`](/en-US/docs/Web/CSS/font-size) of the list to `0`. This only works if the blocks are not sized with `em` units (since `em` is based on `font-size`, the block size would also end up being sized as `0`). Using `rem` units would be a good choice here:
372372

373373
```css
374374
ul {

0 commit comments

Comments
 (0)