These two videos contain a good intro to Flexbox. Worth running through whenever you need a Flexbox refresher.
I’ll include some code snippets here when I get around to it.
<style>
h1 {
text-transform: uppercase;
font-size: 3em;
font-weight: 100;
width: 200px;
}
.parent {
display: flex;
border: 1px solid blue;
flex-direction: column;
justify-content: center;
align-items: center;
width: 800px;
height: 800px;
}
.el {
width: 200px;
border: 1px solid red;
text-align: center;
}
</style>
<main>
<div class="parent">
<h1>Svelte Min</h1>
<p>Here is some text</p>
<div class="el">One</div>
<div class="el">Two</div>
</div>
</main>
justify-content: center;
.align-items: center;
.https://www.freecodecamp.org/news/flexbox-the-ultimate-css-flex-cheatsheet/
When we set flex-direction: column
we are setting the main axis to be vertical.
Then, if we want to align items along the horizontal axis, we need to use align-items.