-4

i have a problem with html or css or both. i am looking for a possibility to create a bar that crosses all divs. The picture above demonstrates my project.

enter image description here

I would like to do it in css rather than to place a separate picture. Is that possible?

thanks ahead.

manuel
  • 1,127
  • 1
  • 8
  • 15

1 Answers1

0

Look into the CSS position property.

.child {
  height: 100px;
  background-color: blue;
  margin: 5px 0;
  border-radius: 8px;
}

.container {
  position: relative;
}

.left-bar {
  position: absolute;
  background-color: red;
  height: 100%;
  width: 20%;
  border-radius: 8px;
}
<div class="container">
  <div class="left-bar">
  </div>
  
  <div class="child">
  </div>
  
  <div class="child">
  </div>
  
  <div class="child">
  </div>
</div>
Alex K
  • 1,937
  • 11
  • 12