How to center the text inside the div? I have the following css code: Should I use line-height property to center the text?
.activebox {
display: inline-block;
width: 40px;
height: 16px;
/*line-height: 20px;*/
background-color: #47DA91;
}
.triangle-left {
display: inline;
width: 0;
height: 0;
border-top: 8px solid transparent;
border-right: 10px solid #47DA91;
border-bottom: 8px solid transparent;
float: left;
}
.activebox p {
color: white;
}
and also the html code:
<div class="triangle-left"></div>
<div class="activebox"><p>Active</p></div>
Here is the jsfiddle example
Thank you.