Bootstrap centering odd thumbnail -


i'm trying center generated thumbnail in row. problem don't know number of thumbnail so... need flexible solution... tried center-block class, isn't working.

here snippet available show exemple of problem (try center 4th thumbnail under first row) : http://www.bootply.com/663prfgvll

and html below :

<div class="col-md-3 col-sm-6 thumb">     <div class="view view-first">         <a href="/photologue/photo/mdl-5/">             <img class="img-portfolio img-responsive" title="mdl 5" src="/media/photologue/photos/cache/mdl_6_thumbnail.jpg" alt="portfolio mdl 5">         </a>         <div class="mask">                  <h4><a href="/photologue/photo/mdl-5/" class="info">mdl 5</a></h4>                 <p class="muted"><small>publiée le 13 avril 2016 16:53</small></p>          </div>     </div> </div>  <div class="col-md-3 col-sm-6 thumb">     <div class="view view-first">         <a href="/photologue/photo/mdl-4/">             <img class="img-portfolio img-responsive" title="mdl 4" src="/media/photologue/photos/cache/mdl_5_thumbnail.jpg" alt="portfolio mdl 4">         </a>         <div class="mask">                  <h4><a href="/photologue/photo/mdl-4/" class="info">mdl 4</a></h4>                 <p class="muted"><small>publiée le 13 avril 2016 16:52</small></p>          </div>     </div> </div>  <div class="col-md-3 col-sm-6 thumb">     <div class="view view-first">         <a href="/photologue/photo/mdl-3/">             <img class="img-portfolio img-responsive" title="mdl 3" src="/media/photologue/photos/cache/mdl_4_thumbnail.jpg" alt="portfolio mdl 3">         </a>         <div class="mask">                  <h4><a href="/photologue/photo/mdl-3/" class="info">mdl 3</a></h4>                 <p class="muted"><small>publiée le 13 avril 2016 16:51</small></p>          </div>     </div> </div>  <div class="col-md-3 col-sm-6 thumb">     <div class="view view-first">         <a href="/photologue/photo/mdl-2/">             <img class="img-portfolio img-responsive" title="mdl 2" src="/media/photologue/photos/cache/mdl_3_thumbnail.jpg" alt="portfolio mdl 2">         </a>         <div class="mask">                  <h4><a href="/photologue/photo/mdl-2/" class="info">mdl 2</a></h4>                 <p class="muted"><small>publiée le 13 avril 2016 16:51</small></p>          </div>     </div> </div>  <div class="col-md-3 col-sm-6 thumb">     <div class="view view-first">         <a href="/photologue/photo/mdl-1/">             <img class="img-portfolio img-responsive" title="mdl 1" src="/media/photologue/photos/cache/mdl_1_thumbnail.jpg" alt="portfolio mdl 1">         </a>         <div class="mask">                  <h4><a href="/photologue/photo/mdl-1/" class="info">mdl 1</a></h4>                 <p class="muted"><small>publiée le 13 avril 2016 16:50</small></p>          </div>     </div> </div>  <div class="col-md-3 col-sm-6 thumb">     <div class="view view-first">         <a href="/photologue/photo/plan-mdl/">             <img class="img-portfolio img-responsive" title="plan mdl" src="/media/photologue/photos/cache/plan_amenagement_couleurs_thumbnail.jpg" alt="portfolio plan mdl">         </a>         <div class="mask">                  <h4><a href="/photologue/photo/plan-mdl/" class="info">plan mdl</a></h4>                 <p class="muted"><small>publiée le 13 avril 2016 16:50</small></p>          </div>     </div> </div> 

i'm looking center last thumb on grid... think pretty simple, but... i'm stuck... !

thanks in advance !

ok, should try search little bit more before asking.... !

got answer here :

http://www.minimit.com/articles/solutions-tutorials/bootstrap-3-responsive-centered-columns

only have :

<div class="container">     <div class="row row-centered">         <div class="col-xs-6 col-centered"></div>         <div class="col-xs-6 col-centered"></div>         <div class="col-xs-3 col-centered"></div>         <div class="col-xs-3 col-centered"></div>         <div class="col-xs-3 col-centered"></div>     </div> </div> 

and css :

/* centered columns styles */ .row-centered {     text-align:center; } .col-centered {     display:inline-block;     float:none;     /* reset text-align */     text-align:left;     /* inline-block space fix */     margin-right:-4px; } 

Comments

Popular posts from this blog

html - Styling progress bar with inline style -

java - Oracle Sql developer error: could not install some modules -

How to use autoclose brackets in Jupyter notebook? -