


How to Achieve a Tall Div Next to Two Shorter Divs on Desktop and Stacked on Mobile?
Nov 19, 2024 pm 05:11 PMOne Tall Div Next to Two Shorter Divs on Desktop and Stacked on Mobile
Problem:
Achieving a layout where three divs are stacked on mobile devices but appear side-by-side on larger screens (desktop).
Solution:
The solution involves disabling flexbox behavior on wider screens and using floats to allow the shorter divs (B and C) to naturally align to the right. On mobile, the flexbox order property is used to reorder the divs as follows:
- Desktop: A-B-C
- Mobile: B-A-C
Code:
<div class="container-fluid"> <div class="row d-flex d-lg-block"> <div class="col-lg-6 order-1 float-left"> A </div> <div class="col-lg-6 order-0 float-left"> B </div> <div class="col-lg-6 order-1 float-left"> C </div> </div> </div>
The above is the detailed content of How to Achieve a Tall Div Next to Two Shorter Divs on Desktop and Stacked on Mobile?. For more information, please follow other related articles on the PHP Chinese website!

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

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

Hot Topics

Adding Box Shadows to WordPress Blocks and Elements

Create a JavaScript Contact Form With the Smart Forms Framework

Create an Inline Text Editor With the contentEditable Attribute

Making Your First Custom Svelte Transition

File Upload With Multer in Node.js and Express

Comparing the 5 Best PHP Form Builders (And 3 Free Scripts)

Best CSS Animations and Effects on CodeCanyon 2025 (Paid Free)
