It seems to me that the class center-block
is missing from the bootstrap 3 style sheets. Am I missing something?
Its usage is described here, http://getbootstrap.com/css/#helper-classes-center
Use class center-block to set an element to center.
It's new in the Bootstrap 3.0.1 release, so make sure you have the latest (10/29)...
Demo: http://bootply.com/91632
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/> <div class="row"> <div class="center-block" style="width:200px;background-color:#ccc;">...</div> </div>
It works far better this way (preserving responsiveness):
<!-- somewhere deep start --> <div class="row"> <div class="center-block col-md-4" style="float: none; background-color: grey"> Hi there! </div> </div> <!-- somewhere deep end -->
http://www.bootply.com/0L5rBI2taZ
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With