Reputation: 97
This is my css
.circle{
border-radius:50%;
border:5px solid black;
width:100px;
height:100px;
box-shadow: 0 0 5px 2px rgba(0,0,0,.35);
font-family:Century Gothic;
color:black;
text-align:center;
}
.circle:hover{
background-image:url(../images/stardust.png) ;
color:#FCB326;
border:5px solid #56a7ba;
}
How can make the text center of circle ? I have try my best to center it but still fail.
Upvotes: 1
Views: 154
Reputation: 7160
Use display: table-cell;
+ vertical-align: middle;
.circle {
border-radius:50%;
border:5px solid black;
width:100px;
height:100px;
box-shadow: 0 0 5px 2px rgba(0, 0, 0, .35);
font-family:Century Gothic;
color:black;
text-align:center;
display: table-cell;
vertical-align: middle;
}
Upvotes: 5