I'm currently working on designing a "tile" that appears as a perfect square block with the content centered precisely in the middle.
Below is the HTML code:
<div class="tile-facebook">
<h5>Facebook</h5>
<div class="tile-notification">4</div>
<h4>notifications</h4>
</div>
Here are the CSS styles applied:
.tile-facebook{
width:175px;
height:175px;
background: #3b5998 ;
text-align: center;
border-radius: 10px;
border-style: solid;
border-color: #ccc;
border-width:1px;
color: white;
}
.tile-notification{
font-size:80px;
font-weight:bold;
padding:10px 0px;
}
Although I have managed to center the text within the block, I am striving for it to be perfectly aligned in the center with equal padding from the top and bottom. Any suggestions on achieving this?