- When a cell is defined as:
<div class= "col-4 col-sm-2 col-md-4"> ... </div>
For small screens, the cell is taking 2/12th of the width (as per col-sm-2).
- But when a cell is defined as:
<div class= "col-4 col-sm col-md-4"> ... </div>
For small screens, the cell is taking 4/12th of the width (as per col-4).
I understand the first case, but not the second.
Why “col-sm” is not getting considered in second case for small screens?
I know that col-4 means 4/12th of the width for all screen size.
But in the first case, for small screens, col-4 got overridden by col-sm-2, then why not in second case col-4 got overridden by col-sm for small screens?
ramank27 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
As you have not mentioned the space, col-sm
will take the entire space instead of 2/12
. It is important to mention the space if you wanna set it different for that div
.
Muhammad Aleem Hashmi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1