I have a row with two Bootstrap columns - one wide and tall, the other short and narrow
https://i.sstatic.net/u7WAf.png
However, for mobile devices (targeted below lg
), I want to change the column order to split into three sections
- Photo Consent
- Organisation Details
- Images
The issue is that Photo Consent and Images share the same column, making it difficult to achieve the desired layout. I end up with both above Organisation or Images on a separate row below on desktop
Is there a way in Bootstrap to accomplish this layout?
Here's the markup for the columns:
<div class="row">
<!-- first column - Organisation Details -->
<div class="col-12 col-lg-7">
<div class="card card-body mb-3">
<h3 class="text-center">Organisation Details</h3>
<div class="row">
<div class="col-12 col-lg-6">
<div class="form-group mb-3">
<label class="form-label" for="name">Name</label>
<input type="text" class="form-control" id="name" name="name" placeholder="Name" maxlength="255" required />
</div>
</div>
<div class="col-12 col-lg-6">
<div class="form-group mb-3">
<label class="form-label" for="slug">URL Slug</label>
<input type="text" class="form-control" id="slug" name="slug" placeholder="URL Slug" maxlength="300" />
</div>
</div>
<div class="col-12 col-lg-6">
<colour-picker title="Primary Colour" name="primary" value="#000000">
</colour-picker>
</div>
<div class="col-12 col-lg-6">
<colour-picker title="Secondary Colour" name="secondary" value="#FFFFFF"></colour-picker>
</div>
</div>
<div class="form-group mb-3">
<label class="form-label" for="description">Description</label>
<textarea rows="7" id="description" class="form-control" name="description" placeholder="Description" ></textarea>
</div>
</div>
</div>
<!-- second column - photo consent and images -->
<!-- on mobile, would prefer to split this column in two and have Photo Consent show above Org Details -->
<div class="col-12 col-lg-5">
<div class="card card-body mb-3">
<h3 class="text-center"><a href="consent">Photo Consent</a></h3>
<div class="form-group mb-3">
<label for="consent">Can we take photos and videos of this organisation?</label>
<select class="form-control style-by-value" name="consent" id="consent" required>
<option value="">-- Please Select --</option>
<option value="1">No</option>
<option value="2">Yes, but...</option>
<option value="3">Yes</option>
</select>
</div>
<small>Consent type updated from web order</small>
</div>
<div class="card card-body mb-3">
<h3 class="text-center">Images</h3>
<div class="alert alert-danger text-center">File uploads are currently unavailable</div>
</div>
</div>
</div>
An alternative solution I considered was duplicating the columns and using d-none
/ d-none-lg
to toggle visibility based on screen size, but this might become messy given the form structure concerns about duplicated columns.