box-sizing vs line-height
SO Question
by Joshua Powell
HTML
<span class="lH">Line-height</span>
<span class="bS">Box-sizing</span>
<span class="both">Both styles!!</span>
CSS
.lH {
width: 80px;
height: 50px;
text-align: center;
display: block;
border-radius: 5px;
border: 2px solid rgba(0, 0, 0, 0.4);
background: #ff7200;
line-height: 50px;
margin-bottom: 50px;
}
.bS {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
width: 80px;
height: 50px;
text-align: center;
display: block;
border-radius: 5px;
border: 2px solid rgba(0, 0, 0, 0.4);
background: mediumSeaGreen;
padding: 12px 0;
margin-bottom: 50px;
}
.both {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
width: 90px;
height: 50px;
text-align: center;
display: block;
border-radius: 5px;
border: 2px solid rgba(0, 0, 0, 0.6);
background: brown;
line-height: 50px;
}