sixfootsixdesigns / bootstrap-3-grid-columns-clearing Goto Github PK
View Code? Open in Web Editor NEWBootstrap 3 Grid Columns Clearing
License: MIT License
Bootstrap 3 Grid Columns Clearing
License: MIT License
Thanks for this solution , i has search in google for some day with this solution , also it work in cross browser ? i need using this for my project !! many thanks !! Regards
thanks (Y)
Currently, SASS will try to compile and generate Undefined variable: $screen-sm-min
. See screenshot below:
What you want to do is rename your multi-columns-row.scss
file to begin with an underscore to prevent it from being compiled on its own:
multi-columns-row.scss
> multi-columns-row.css
(compiled... generates the above error)_multi-columns-row.scss
> (not compiled)Lemme know what you think :)
Hi there,
Thanks for your nice solution.
Problem: I realized that there is a limitation in your solution, which is you have to put all classes in order to make it work like this:
<div class="col-xs-6 col-sm-4 col-md-4 col-lg-4">...</div>
but it seems that col-md-4
and col-lg-4
in the above code can be removed.
My solution is this:
/* Bootstrap multi-same-columns
**************************************************/
/* clear first in row in ie 8 or lower */
.multi-columns-row .first-in-row {
clear: left;
}
/* clear the first in row for any block that has the class "multi-columns-row" */
.multi-columns-row .col-xs-6:nth-child(2n + 3) { clear: left; }
.multi-columns-row .col-xs-4:nth-child(3n + 4) { clear: left; }
.multi-columns-row .col-xs-3:nth-child(4n + 5) { clear: left; }
.multi-columns-row .col-xs-2:nth-child(6n + 7) { clear: left; }
.multi-columns-row .col-xs-1:nth-child(12n + 13) { clear: left; }
@media (min-width: 768px) {
/* reset if we have sm class */
.multi-columns-row [class*="col-"][class*="col-sm-"]{ clear: none; }
/* clear first in row for small columns */
.multi-columns-row .col-sm-6:nth-child(2n + 3) { clear: left; }
.multi-columns-row .col-sm-4:nth-child(3n + 4) { clear: left; }
.multi-columns-row .col-sm-3:nth-child(4n + 5) { clear: left; }
.multi-columns-row .col-sm-2:nth-child(6n + 7) { clear: left; }
.multi-columns-row .col-sm-1:nth-child(12n + 13) { clear: left; }
}
@media (min-width: 992px) {
/* reset if we have md class */
.multi-columns-row [class*="col-"][class*="col-md-"]{ clear: none; }
/* clear first in row for medium columns */
.multi-columns-row .col-md-6:nth-child(2n + 3) { clear: left; }
.multi-columns-row .col-md-4:nth-child(3n + 4) { clear: left; }
.multi-columns-row .col-md-3:nth-child(4n + 5) { clear: left; }
.multi-columns-row .col-md-2:nth-child(6n + 7) { clear: left; }
.multi-columns-row .col-md-1:nth-child(12n + 13) { clear: left; }
}
@media (min-width: 1200px) {
/* reset if we have lg class */
.multi-columns-row [class*="col-"][class*="col-lg-"]{ clear: none; }
/* clear first in row for large columns */
.multi-columns-row .col-lg-6:nth-child(2n + 3) { clear: left; }
.multi-columns-row .col-lg-4:nth-child(3n + 4) { clear: left; }
.multi-columns-row .col-lg-3:nth-child(4n + 5) { clear: left; }
.multi-columns-row .col-lg-2:nth-child(6n + 7) { clear: left; }
.multi-columns-row .col-lg-1:nth-child(12n + 13) { clear: left; }
}
Now you can use this code:
<div class="col-xs-6 col-sm-4">...</div>
instead of:
<div class="col-xs-6 col-sm-4 col-md-4 col-lg-4">...</div>
or
<div class="col-xs-6 col-md-4">...</div>
instead of
<div class="col-xs-6 col-sm-6 col-md-4 col-lg-4">...</div>
Hope that helps.
it dont work in bootstrap 3 carousel !
Awesome solution. I'm trying to get this to work within an ng-repeat, angularjs. not having any luck. Have any pointers?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.