Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I make card-columns order horizontally?

Tags:

I have a smart-scrolling list of cards, and while I love the look of card-columns, its pretty frustrating that it orders top to bottom, like so: 1 4 7 2 5 8 3 6 9

This vertical ordering seems basically useless for anything where the content loads more than a few items. If I have 50 items, some of the least important ones will be at the top!

I've tried some variations using flexbox, but couldn't get anything to work. Does anyone have horizontal ordering working?

like image 223
thouliha Avatar asked Aug 01 '16 17:08

thouliha


People also ask

How to create column cards in HTML?

How To Create Column Cards Step 1) Add HTML: Example <div class="row"> <div class="column"> <div class="card">..</div> </div> <div class="column"> <div class="card">..</div> </div> <div class="column"> <div class="card">..</div> </div> <div class="column"> <div class="card">..</div> </div> </div> Step 2) Add CSS:

How to create responsive column cards with CSS?

Learn how to create responsive column cards with CSS. Try it Yourself » How To Create Column Cards Step 1) Add HTML: Example <div class="row"> <div class="column"> <div class="card">..</div> </div> <div class="column">

How to horizontally sort data in Excel?

Click on options button → Select sort left to right & click OK. Now select the row on the basis of which you want to sort your data & click OK. Congratulations! you have horizontally sort your data. Important Note: With Excel tables your are not able to use this technique.

How to change the Order of the rendered columns in CSS?

Show activity on this post. As documented, the order of the CSS columns is top to bottom, then left to right so the order of the rendered columns will be.. There is no way to change the order of CSS columns.


1 Answers

Found here a nice and basic solution (not directly for bootstrap) to set a masonry vertical or horizontal with css http://w3bits.com/flexbox-masonry/

I will give a test and give feedback how to use with bootstrap 4.

for horizontal usage:

.masonry {    display: flex;   flex-flow: row wrap;   margin-left: -8px; /* Adjustment for the gutter */ }  .masonry-brick {   flex: auto;   height: 250px;   min-width: 150px;   margin: 0 8px 8px 0; /* Some gutter */ } .masonry-brick {   &:nth-child(4n+1){      width: 250px;   }   &:nth-child(4n+2){      width: 325px;   }   &:nth-child(4n+3){      width: 180px;   }   &:nth-child(4n+4){      width: 380px;   } } 

for vertical usage:

.masonry {    display: flex;   flex-flow: column wrap;   max-height: 800px;   margin-left: -8px; /* Adjustment for the gutter */ }  .masonry-brick {   margin: 0 8px 8px 0; /* Some gutter */ }  
like image 93
karadayi Avatar answered Sep 20 '22 16:09

karadayi