In the Bootstrap documentation itself there is a comparative table between grid classes.
Thatis,the.col-xs-*
classsetsthegridfordeviceswithascreenwidthoflessthan768px.Class.col-sm-*
setsforscreensgreaterthan768px.Class.col-md-*
setsforscreensgreaterthan970pxandclass.col-lg-*
forscreensgreaterthan1200px.It'sbasicallyusedtodefinedifferentgridsforyourelement,basedonthesizeofyouruser'sdisplay.
Forexample,youmaywanttodisplayasectorofyoursiteintwocolumnsonmonitors,settingthe.col-sm-6
classtoeach.However,onsmall-screendeviceslikecellphones,twocolumnsmaynotbeideal,leavingthecontentsqueezedandsmall,soyoucandefinethatinthesedevices,insteadoftwocolumns,thissectorisinonlyonecolumn,withtheclass.col-xs-12
.
Basicallyyouaretellingthebrowser:iftheuser'sscreenhasawidthgreaterthanorequalto768px,displaythisdiv
occupying6ofthe12columnsofmygrid.Already,ifthewidthislessthan768px,displayitbyoccupying12ofthe12gridcolumns.
<divclass="col-xs-12 col-sm-6">...</div>
This is a very useful feature especially when you have, for example, a list of products in a virtual store. You can define how many products appear per row in each display by setting the column size.
<div class="col-xs-12 col-sm-4 col-md-3 col-lg-2">{Produto}</div>
Thus, 1 product would appear for extra small devices , occupying 12 of 12 columns of the grid, 3 products in small devices , occupying 4 of 12 columns, 4 products in medium devices , occupying 3 of 12 columns and 6 products in large devices , occupying 2 of 12 columns.
Personal Note: The grid system is, in the form presented, the main functionality of Bootstrap implementing the Mobile First philosophy and responsiveness. If you already use it and did not know such a difference, I recommend that you study the documentation a little more before continuing or searching for another method of study. (Take this as a positive review)