I need the 3 circles centered in there containers and then i need the text inside to be centered horizontally and verticaly.
How can I center the text vertically
I know the border radius won’t work in IE8 but I don’t mind it being a square there.
<div class="container">
<div class="row">
<div class="col-md-4 block text-center">
<p class="circle">Some Text here Some text here Some text here Some text here</p>
</div>
<div class="col-md-4 block">
<p class="circle">Some Text here</p>
</div>
<div class="col-md-4 block">
<p class="circle">Some More Text here</p>
</div>
</div>
</div>
.block{
border: 1px solid red;
text-align: center;
vertical-align: middle;
}
.circle{
background: red;
border-radius: 200px;
color: white;
height: 200px;
font-weight: bold;
width: 200px;
}
you have to keep in mind that , while you can ‘easily’ center text in a circle, there is no way (yet) to wrap the text so that it stays within the bounds of a circle. so it is advisable rot calculate some padding into the mix.
here is an alternate way of doing the this trick ( bonus, you only have to declare the width of your circle)
<style>
p{
background: pink;
border-radius: 50%;
width: 20%;
padding:2em;
box-sizing: border-box;
text-align: center;
}
p:before {
content:'';
height:0;
margin:100% 0 0 0;
display:inline-block;
vertical-align: middle;
}
p span { display: inline-block; vertical-align: middle;}
</style>
<p><span>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat</span></p>