Martin AJ Martin AJ - 2 months ago 5x
CSS Question

How can I reduce the length of the element's border?

My question is really short and clear .. I want a shorter separator than this:

border-left: 1px solid;
margin-left: 4px;
padding-left: 4px;
height: 3px;

<span>Age</span><span class="myclass">21</span>

This is expected output:

enter image description here

As you see, I've set
height: 3px
but still the height of that
is bigger than
. How can I make that border shorter?

Pat Pat

Setting the height of an inline element will have no effect. Add display: inline-block; for it to respect height: 3px;