Home > Article > Web Front-end > Why Are My Bootstrap xs Columns Wrapping Instead of Stacking Below 360px?
The Bootstrap framework simplifies responsive design by providing utilities for creating flexible and efficient layouts. However, users sometimes encounter unexpected issues when columns do not behave as anticipated, especially in the extra small (xs) size.
Normally, when a row's columns add up to 12, they should stack vertically as the screen width decreases. However, on smaller screens, a column may unexpectedly wrap towards the beginning of the screen instead of the end.
This behavior arises due to a known issue in Bootstrap. In screen widths less than 360px, columns with a width of 1% (col-xs-1) may not fit properly within the container. Despite specifying a 1% width, the 15px padding on both sides effectively makes the column wider, causing a mismatch with the browser's layout engine.
To avoid this issue, consider not using col-xs-1 on screens smaller than 360px. Determine if your application realistically anticipates users resizing the screen below this limit.
In Bootstrap 4, the col-xs-1 class has been renamed to col-1. The issue described above still applies to col-1 in Bootstrap 4.
The above is the detailed content of Why Are My Bootstrap xs Columns Wrapping Instead of Stacking Below 360px?. For more information, please follow other related articles on the PHP Chinese website!