Skip to content

Commit 9c339cc

Browse files
authored
Update FAQs
1 parent c169250 commit 9c339cc

File tree

1 file changed

+39
-1
lines changed

1 file changed

+39
-1
lines changed

README.md

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,45 @@ This will center the image horizontally within the parent `section` element. The
380380
</details>
381381

382382
<details>
383-
<summary>How can I change the header from having 1 column to having 2 columns?</summary>
383+
<summary>How can I center align elements within a Flexbox container?</summary>
384+
<br>
385+
To center align elements within a Flexbox parent container, you can use the `justify-content` property and set it to `center`. This will horizontally center the elements within the Flexbox container.
386+
387+
**Example:**
388+
389+
```css
390+
.container {
391+
display: flex;
392+
justify-content: center; /* Center elements horizontally */
393+
}
394+
395+
```
396+
397+
398+
399+
You can also use the `align-items` property and set it to `center` to vertically center align the elements within the Flexbox container.
400+
401+
Example:
402+
403+
```css
404+
.container {
405+
display: flex;
406+
justify-content: center; /* Center elements horizontally */
407+
align-items: center; /* Center elements vertically */
408+
}
409+
```
410+
<br>
411+
412+
413+
For more information and an interactive Flexbox guide, check: [An Interactive Guide to Flexbox](https://www.joshwcomeau.com/css/interactive-guide-to-flexbox)
414+
415+
<br>
416+
417+
[Back to top](#faqs)
418+
</details>
419+
420+
<details>
421+
<summary>How can I change the header from having 1 column to having 2 columns using Flexbox?</summary>
384422
<br>
385423

386424
To change the header of an HTML page from having one column to having two columns using Flexbox, you should do the following in your CSS:

0 commit comments

Comments
 (0)