Home > database >  How to reduce letter spacing between div letters H,2,O
How to reduce letter spacing between div letters H,2,O

Time:12-06

  div  { 
    display: inline;

}
.sub1{
    vertical-align: sub;
    font-size:x-small;
}
    <div>H</div>
    <div >2</div>
    <div>O</div>
Problem is the letter space between H, 2(subscript), 0 renders high and I wanna compact the letter spacing more.

I can't use letter-spacing less than 1 px as it is not effective.

CodePudding user response:

Write in one div and only wrap 2 in span

div  { 
    display: inline;

}
.sub1{
    vertical-align: sub;
    font-size:x-small;
}
<div>
H<span >2</span>O
</div>

  • Related