I'm trying to make a circle shaped div with some text directly in the middle. I can get it horizontally in the middle, easily but I am having loads of trouble getting it in the vertical center, I've tried doing vertical-align, padding, display etc but it'll always stay right at the top.
Here's the offending HTML:
<div class="widget">
<p id='case'>{27 cases}</p>
</div>
And here's the CSS for that div:
.widget {
background-color: #ff1122;
color: yellow;
width: 150px;
height: 150px;
border-radius: 100%;
text-align: center;
font-size: 24px;
vertical-align: middle;
}
I'm trying to get the text precisely in the middle of the circle vertically. How can I do this?