


Can Bootstrap\'s Push/Pull Classes Reorder Equal-Sized Columns on Mobile Devices?
Reordering Bootstrap Columns with Push/Pull: Limitations and Alternative Approaches
When dealing with columns of equal size (.col-*-12), a common query arises regarding the feasibility of changing their order using Bootstrap's push and pull directives. The purpose of this query is to understand if it's possible to reverse the placement of two such columns on devices with mobile screen sizes.
Limitations of Push/Pull
Unfortunately, it's not possible to reorder .col-*-12 columns using push and pull classes. This is due to the fact that the sum of these columns exceeds the predefined grid size of 12 columns, as specified by the @grid-columns variable in Bootstrap.
Alternative Approaches
To achieve the desired reordering, consider the following alternatives:
1. Modifying HTML Structure and Using Push/Pull for Larger Screens:
Rearrange the columns within the HTML and apply push/pull classes to achieve the desired order on larger screens. For instance:
<code class="html"><div class="row"> <div class="col-xs-12 col-sm-6 col-sm-push-6"> <p>test2</p> </div> <div class="col-xs-12 col-sm-6 col-sm-pull-6"> <p>test1</p> </div> </div></code>
2. Using CSS Transforms to Reverse Column Order on Mobile:
Apply the following CSS to reverse the ordering of vertically stacked columns on devices with a screen size of 767px or less:
<code class="css">@media (max-width: 767px) { .row.reorder-xs { transform: rotate(180deg); direction: rtl; /* Fix horizontal alignment */ } .row.reorder-xs > [class*="col-"] { transform: rotate(-180deg); direction: ltr; /* Fix horizontal alignment */ } }</code>
Note that this approach requires the use of HTML class specific to the desired columns to be reordered.
The above is the detailed content of Can Bootstrap\'s Push/Pull Classes Reorder Equal-Sized Columns on Mobile Devices?. For more information, please follow other related articles on the PHP Chinese website!

For a while, iTunes was the big dog in podcasting, so if you linked "Subscribe to Podcast" to like:

We lost Opera when they went Chrome in 2013. Same deal with Edge when it also went Chrome earlier this year. Mike Taylor called these changes a "Decreasingly

From trashy clickbait sites to the most august of publications, share buttons have long been ubiquitous across the web. And yet it is arguable that these

In this week's roundup, Apple gets into web components, how Instagram is insta-loading scripts, and some food for thought for self-hosting critical resources.

When I was looking through the documentation of git commands, I noticed that many of them had an option for . I initially thought that this was just a

Sounds kind of like a hard problem doesn't it? We often don't have product shots in thousands of colors, such that we can flip out the with . Nor do we

I like when websites have a dark mode option. Dark mode makes web pages easier for me to read and helps my eyes feel more relaxed. Many websites, including

This is me looking at the HTML element for the first time. I've been aware of it for a while, but haven't taken it for a spin yet. It has some pretty cool and


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Zend Studio 13.0.1
Powerful PHP integrated development environment

SublimeText3 Linux new version
SublimeText3 Linux latest version

Atom editor mac version download
The most popular open source editor

SublimeText3 Mac version
God-level code editing software (SublimeText3)

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft