'How could you build this? It seems really hard to make the lines [closed]

This is what I'm trynna achieve but I don't know how to put the lines next to the boxes, what would be a way of doing this? With display or position?

Picture of what I want to achieve



Solution 1:[1]

You can use position: absolute and some coordinate for that like below:

* {
  box-sizing: border-box;
}

body {
  background-color: orange;
  padding: 50px;
}

.item {
  background-color: blue;
  padding: 10px;
  border-radius: 20px;
  width: 150px;
  margin-bottom: 20px;
}

.container {
  width: 100px;
  height: 120px;
  position: absolute;
  left: 200px;
  top: 78px;
  display: flex;
  flex-direction: column;
  z-index: -1;
}

.div1,
.div2 {
  border: solid white;
  border-left: none;
  height: 50%;
}

.div1 {
  border-bottom: none;
}
<div class="item">1</div>
<div class="item">2</div>
<div class="item">3</div>

<div class="container">
  <div class="div1"></div>
  <div class="div2"></div>
</div>

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Arman Ebrahimi