<div class="container">
<div class="flex__container">
<div class="flex__item"></div>
<div class="flex__item" style="--flex: 1 2"></div>
<div class="flex__item" style="--flex: 2 30vw"></div>
</div>
</div>
@import url("https://fonts.googleapis.com/css?family=Gochi+Hand");
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
width: 100vw;
min-height: 100vh;
margin: 0;
padding: 10vh;
background-color: #291642;
font-family: "Gochi Hand", sans-serif;
font-size: 130%;
letter-spacing: 0.1rem;
color: #fff;
display: flex;
justify-content: space-evenly;
align-items: center;
}
:root {
--flex: none;
}
.flex__container {
display: flex;
inline-size: 80vw;
block-size: 30vh;
border: 1px dashed #e91e63;
border-color: #ffeb3b #ff5722 #fff #00bcd4;
position: relative;
counter-reset: listCounter;
}
.flex__item {
display: flex;
justify-content: center;
align-items: center;
counter-increment: listCounter;
flex: var(--flex);
}
.flex__item::before {
content: "[" counter(listCounter) "]";
font-size: 2rem;
background: rgba(0, 0, 0, 0.65);
padding: 4px;
border-radius: 4px;
}
.flex__item:nth-child(1) {
background-color: #f36;
}
.flex__item:nth-child(2) {
background-color: #cddc39;
}
.flex__item:nth-child(3) {
background-color: #2196f3;
}
.flex__item:nth-child(4) {
background-color: #ff5722;
}
.flex__container::after {
content: attr(data-justify-content);
position: absolute;
top: calc(100% + 5vh);
left: 50%;
transform: translate(-50%, 0);
}
View Compiled
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.