I just used the existing .center-block helper class from the library, as well as the .text-center class, to center the contents of each div . ( see documentation for bootstrap 3.x )
I'm not sure that this is exactly what you want, but it should help you get closer to your results.
Let me know if he needs a setting.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css"> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> <div class="row"> <div class="col-xs-12"> <h2>My approach (simplistic)</h2> <a href="#" class="my-icon"> <img src="http://lorempixel.com/300/300" class="center-block img-responsive img-circle" alt="Responsive image" /> </a> </div> </div> <hr/> <div class="row"> <div class="col-xs-12"> <h2>Your approach (w/ added elements)</h2> <div class="col-post"> <div class="post-img center-block text-center"> <a href="#" class="my-icon">my-icon</a> <a href="mylink"> <div class="overlay"> <img src="http://lorempixel.com/300/300?asdf" alt="#" class="img-responsive center-block"> </div> </a> </div> <div class="post-icons center-block text-center">post icons</div> </div> </div> </div>
ochi source share