* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: #cec;
    color: #234;
    font-family: verdana;
}

h1 {
    text-align: center;
    margin: 8px 0;
    border-bottom: 2px solid #234;
    padding: 8px;
}

h2 {
    margin: 8px;
    font-weight: normal;
    background-color: #234;
    color: #cec;
    padding: 4px;
}

/* This demo (1) shows how to use flex grow */
.flex-parent {
    border: 4px solid transparent;
    min-height: 100px;
    display: flex;
    margin: 8px 8px 40px 8px;
}

.flex-child {
    border: 4px solid green;
    min-height: 80px;
    margin: 8px;
    flex-grow: 1;
    text-align: center;
    font-weight: bold;
}

/* This demo shows how to use justify-content space around */
.demo2 .flex-parent {
    border: 4px solid transparent;
    justify-content: space-around;
}

.demo2 .flex-child {
    border: 4px solid black;
    flex-grow: 0;
    min-width: 16px;
}

/* This demo shows how to use justify-content space between */
.demo3 .flex-parent {
    justify-content: space-between;
    border: 4px solid transparent;
}

.demo3 .flex-child {
    flex-grow: 0;
    min-width: 16px;
    border: 4px solid black
}

/* This demo shows how to use justify-content space evenly */
.demo4 .flex-parent {
    justify-content: space-evenly;
    border: 4px solid transparent;
}

.demo4 .flex-child {
    flex-grow: 0;
    min-width: 16px;
    border: 4px solid black
}

.demo5 .flex-parent,
.demo6 .flex-parent {
    border: 4px solid transparent;
}

/* This demo shows how to use flex-direction */
.demo5 .flex-parent {
    flex-direction: row-reverse;
}

.demo5 .flex-child:last-child {
    background-color: yellow;
}

/* This demo shows how to use flex-wrap */
.demo6 .flex-parent {
    display: flex;
    flex-flow: row wrap; /* flex-direction, flex-wrap*/
    justify-content: space-evenly;
}

.demo6 .flex-child {
    background-color: pink;
    min-width: 200px;
    flex-grow: 1;
}

/* This demo shows how to horizontally center a element using justify content center */
.demo7 .flex-parent {
    border: 4px solid transparent;
    min-height: 200px;
    justify-content: center; /* horizontal center */
}
.demo7 .flex-child {
    flex-grow: 0;

}

.demo7 .flex-child:last-child {
    background-color: yellow;
    max-height: 100px;
    min-width: 100px;
    aspect-ratio: 1;
    align-self: center; /* vertical center */
}

/* This demo shows how to use flex-basis */
.demo8 .flex-parent {
    flex-flow: row wrap;
    justify-content: center;
    gap: 10px;
}

.demo8 .flex-child {
    flex-basis: 25%;
    margin: 0;
    flex-grow: 1;
}