0

I am having problems with css, how can I make the dots to be always centered based on li height? Also how do I set proper height of first and last element, li has different height based on content so I can't use calc, is this even possible?

What am I trying achieve: Image

body {
  margin: 0;
}
.tree {
  position: relative;
}

.tree {
  position: relative;
  list-style: none;
}

li {
  padding-bottom: 1.5rem;
  border-left: 1px solid #abaaed;
  position: relative;
  padding-left: 20px;
  margin-left: 10px;
  max-height: 100px;
}

li:last-child {
  padding-bottom: 0;
    border: none;
}

li::before {
   content: '';
    width: 15px;
    height: 15px;
    background: white;
    border: 1px solid #4e5ed3;
    border-radius: 50%;
    position: absolute;
    left: -8px;
    top: 0px;
}

li::after {
    content: '';
    width: 10px;
    height: 2px;
    position: absolute;
    left: 7px;
    top: 6px;
    background: #4e5ed3;
}

button {
  padding: 10px 20px;
}
<div>
<ul class="tree">
<li><Button>Start</Button></li>

<li>
Lorem ipsum is placeholder text commonly used in the graphic, print, and publishing industries for previewing layouts and visual mockups.
</li>
<li><Button>
End</Button></li>
</ul>
</div>

Lorem ipsum is placeholder text commonly used in the graphic, print, and publishing industries for previewing layouts and visual mockups.

Dave
  • 1
  • 1
  • 9
  • 38
  • Why do you close this question? The links dont help at all – Dave May 22 '21 at 12:28
  • because you need to center your absolute elements and the duplicate will tell you "how to center an absolute element" (take the time to read them) – Temani Afif May 22 '21 at 12:30

0 Answers0