Martin AJ Martin AJ - 1 year ago 65
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
Answer Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download