To begin, it is essential to use semantic HTML. Additionally, you have the option to incorporate pseudoelements with gradient backgrounds to create the dashed lines.
However, this technique can be delicate as it relies on specific numbers for alignment, which may vary based on font and checkbox size. In the future, utilizing anchor positioning could offer a solution. For now, the most precise approach would involve using SVG or canvas to draw the lines accurately according to element positions.
Having said that, here is a brief CSS attempt at achieving the effect:
ul {
padding: 0;
list-style-type: "";
--dash-color: lightgray;
--dash-length: 3px;
--dash-gap: 5px;
}
ul ul {
--nested-list-indent: 20px;
padding-inline-start: var(--nested-list-indent);
}
li {
position: relative;
display: flex;
align-items: start;
--column-gap: .5ch;
column-gap: var(--column-gap);
}
.li-content {
}
li input[type="checkbox"] {
translate: 0 -.14rem;
}
li::before {
display: block;
content: "";
position: absolute;
inset-block: .5rem;
inset-inline-start: .64rem;
width: 2px;
background-image: repeating-linear-gradient(
to bottom,
var(--dash-color),
var(--dash-color) var(--dash-length),
transparent var(--dash-length),
transparent calc(var(--dash-length) + var(--dash-gap))
);
}
li li::before {
width: calc(var(--nested-list-indent) + var(--column-gap) + 1rem);
height: 2px;
inset-inline-start: calc(-1 * var(--nested-list-indent) - var(--column-gap) - .5rem);
background-image: repeating-linear-gradient(
to right,
var(--dash-color),
var(--dash-color) var(--dash-length),
transparent var(--dash-length),
transparent calc(var(--dash-length) + var(--dash-gap))
);
}
hr {
border: none;
background-image: repeating-linear-gradient(
to right,
var(--dash-color),
var(--dash-color) var(--dash-length),
transparent var(--dash-length),
transparent calc(var(--dash-length) + var(--dash-gap))
);
height: 2px;
}
<ul>
<li>
<input id="ee" name="ee" type="checkbox" checked>
<div>
<label for="ee">Electronic Equipment</label>
<p>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Illo in consectetur doloribus quam, rem magnam dicta autem voluptate dolor delectus.</p>
<hr>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit.</p>
<ul>
<li>
<input id="ec" name="ec" type="checkbox">
<label for="ec">Escalation Clause</label>
</li>
<li>
<input id="ef" name="ef" type="checkbox">
<label for="ef">Express Freight</label>
</li>
</ul>
</div>
</li>
</ul>