Reputation: 5
In this jsFiddle you can see a div with some span element in it.
Why there is a gap between first line and the top div border line? Is it a default line-height? I have set no line-height in my css class.
http://h33i.img-up.net/Bildschirm4fda.png
How can I remove this gap in different browsers also with different fonts?
<div id="draggable-title2">
<span style="color: rgb(0, 0, 0); font-family: verdana; font-size: 40px; padding-top: 0px;display: inline-block;">
Hello World
<br />next line
</span>
</div>
Upvotes: 0
Views: 2189
Reputation: 40639
Add this in css
span{
padding:0;
line-height:30px;
}
Or you use margin
like,
span{
padding:0;
line-height:33px;
margin:-2px auto;
}
Upvotes: 3
Reputation: 15749
If you want to only fix the top spacing, check the below solution.
The Code Change:
<span style="color: rgb(0, 0, 0); font-family: verdana; font-size: 40px; padding-top: 0px;display: inline-block; margin-top:-10px;">
Upvotes: 2