Here you can use a pseudo-element :before
with a transparent border. You can indent a list item by changing the width of the pseudo-element. Along with this, you can change the list marker if you install list-style: none;
and install color
incontent
EDIT:
removed display: block
and color: transparent
used the space \00a0
as content.
li:before {
float: left;
content: "\00a0";
width: 20px;
border: 1px solid transparent;
}
<ul>
<li>One</li>
<li>Two</li>
<li>Three</li>
<li>Four</li>
</ul>
Run codeHide result( display: block
, @dippas, border-top
border
- )
ul {
list-style: none;
counter-reset: cnt;
}
li:before {
float: left;
counter-increment: cnt;
content: counter(cnt)" \25b6";
max-height: 100%;
width: 25px;
border: 1px solid transparent;
margin-top: -.2em;
color: green;
}
<ul>
<li>One</li>
<li>Two</li>
<li>Three</li>
<li>Four</li>
</ul>
Hide result