Flex
<body>
<div class="container">
<div class="item">
<p>Flex</p>
<p></p>
<p>Grid</p>
<p></p>
</div>
</div>
</body>
.container {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: center;
align-items: center;
align-content: flex-start;
}
.item {
flex-grow: 1;
flex-basis: 0;
flex: 1;
}
.item:nth-child(1) {
flex: 1;
order: 2;
}
.item:nth-child(2) {
align-self: center;
order: 1;
}
Grid
<body>
<div class="container">
<p>Flex</p>
<p></p>
<p>Grid</p>
<p></p>
<p>Flex</p>
<p></p>
<p>Grid</p>
<p></p>
<p>Flex</p>
<p></p>
<p>Grid</p>
<p></p>
</div>
</body>
.container {
display: grid;
grid-template-columns: 4fr 6fr;
grid-template-columns: 200px 1fr;
grid-gap: 1rem;
grid-auto-rows: 200px;
grid-auto-rows: minmax(200px, auto);
justify-items: center;
align-itmes: center;
}
.item.nth-child(1) {
grid-column: 1/4;
}
.item.nth-child(4) {
grid-column: 3;
grid-row: 2/4;
}
.item:nth-child(5) {
jutify-self: start;
align-self: center;
}
참고
CSS Flexbox와 CSS Grid, 한번에 정리!