JSFiddle - React, Tailwind, and code Playground
HTML
<div class="block">
<div class="item">1</div>
<div class="item">2</div>
<div class="item">3</div>
<div class="item">4</div>
</div>
CSS
* {
box-sizing: border-box
}
.block {
position: relative;
display: flex;
justify-content: space-between;
width: 90%;
min-width: 630px;
padding-top: 100px;
margin: auto;
}
.block::before {
content: "";
position: absolute;
display: block;
top: 0;
left: 50%;
width: 1px;
height: 40px;
background: #999;
}
.block::after {
content: "";
position: absolute;
display: block;
top: 40px;
left: 50%;
transform: translateX(-50%);
width: calc(100% - 150px);
height: 1px;
background: #999;
}
.item {
position: relative;
display: flex;
justify-content: center;
align-items: center;
width: 150px;
height: 150px;
background: #9BC4E7;
border-radius: 10px;
}
.item::before {
content: "";
position: absolute;
display: block;
bottom: calc(100% + 10px);
left: 50%;
width: 1px;
height: 50px;
background: #999;
}
@media (max-width: 650px) {
.block {
flex-wrap: wrap;
width: 250px;
min-width: initial;
padding-top: 0;
padding-left: 100px;
}
.block::before {
left: 0;
top: 50%;
width: 40px;
height: 1px;
background: #999;
}
.block::after {
left: 40px;
top: 50%;
transform: translateY(-50%);
width: 1px;
height: calc(100% - 150px);
background: #999;
}
.item:not(:last-child) {
margin-bottom: 10px;
}
.item::before {
left: initial;
right: calc(100% + 10px);
bottom: 50%;
width: 50px;
height: 1px;
background: #999;
}
}