As said in the title, how do we remove empty white spaces from top and bottom of a string div?
I used Chrome inspect tool to check the div but there aren't any margins or paddings. I also tried to play around with the height and line-height of the div but I think it is a little bit of a hack fix.
.top {
height: 20px;
width: 100%;
background-color: green;
}
.bottom {
height: 20px;
width: 100%;
background-color: red;
}
.middle {
font-size: 50px;
}
<div class="top"></div>
<div class="middle">HelloWorld</div>
<div class="bottom"> </div>