Reputation:
Why btnow
has some top margin?
Its css is top:0
.
.btnowwrap{
position:relative;
height:20px;
background:gold;
}
.btnow{
position:absolute;
right:9px;
top:0;
cursor:pointer;
font-size:19px;
color:#777;
}
<div class='btnowwrap'>
<div class='btnow' id='btnow' title='SADA'>♻</div>
</div>
Upvotes: 0
Views: 48
Reputation: 351
If you dont want to reduce font size then use
.btnow { line-height: 100% }
it will fit. You can reduce font size too but line-height is the best solution.
Upvotes: 0
Reputation: 16251
The icon is in top:0
this space is because the height
of icon(see image):
Use line-height: 1em;
.btnowwrap{
position:relative;
height:20px;
background:gold;
}
.btnow{
position:absolute;
right:9px;
top:0;
cursor:pointer;
font-size:19px;
color:#777;
line-height: 1em;
}
<div class='btnowwrap'>
<div class='btnow' id='btnow' title='SADA'>♻</div>
</div>
Upvotes: 0
Reputation: 5544
Apply line-height:100%;
.btnowwrap{
position:relative;
height:20px;
background:gold;
}
.btnow{
position:absolute;
right:9px;
top:0;
cursor:pointer;
font-size:19px;
color:#777;
line-height: 100%;
}
<div class='btnowwrap'>
<div class='btnow' id='btnow' title='SADA'>♻</div>
</div>
Upvotes: 3