Rearrange the column order for optimal display on both mobile and desktop views

Looking to implement the designs below using grid layout:

I attempted this approach, but it did not achieve the desired outcome.

http://jsfiddle.net/tomalex0/3fesK/3/

<div>
   <div class="col-md-9 col-md-push-3 row-one">1</div> 
   <div class="col-md-3 col-md-pull-9 row-two">2</div>
   <div class="col-md-9 col-md-push-3 row-three">3</div>
</div>

Avoiding the use of absolute positioning, as the footer conflicts with absolute div elements.

Please advise if there is an alternate solution.

Answer №1

<div>
    <div class="col-xs-12 col-sm-9 pull-right">A</div>
    <div class="col-xs-12 col-sm-3 pull-left">B</div>
    <div class="col-xs-12 col-sm-9 pull-right">C</div>
</div>

http://jsfiddle.net/abc123/45YtS/

Answer №2

Check out this bootply showcasing the majority of your solution. You may need to account for other viewport sizes to ensure it works seamlessly across all devices, but much of the groundwork has been laid out. I created multiple containers labeled 2 to construct the desktop layout and hid them for the mobile view, and vice versa.

<div class="container">
<div class="row">
    <div class="col-md-4 hidden-sm">
        <div class="panel panel-default">
            <div class="panel-heading text-center">
                    <h3 class="panel-title">2</h3>

            </div>
            <div class="panel-body"></div>
        </div>
    </div>
    <div class="col-md-8 col-sm-12">
        <div class="panel panel-default">
            <div class="panel-heading text-center">
                    <h3 class="panel-title">1</h3>

            </div>
            <div class="panel-body"></div>
        </div>
    </div>
    <div class="col-sm-12 hidden-lg">
        <div class="panel panel-default">
            <div class="panel-heading text-center">
                    <h3 class="panel-title">2</h3>

            </div>
            <div class="panel-body"></div>
        </div>
    </div>
    <div class="col-md-8 col-md-offset-4 col-sm-12">
        <div class="panel panel-default">
            <div class="panel-heading text-center">
                    <h3 class="panel-title">3</h3>

            </div>
            <div class="panel-body"></div>
        </div>
    </div>
</div>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Applying Transparency with CSS Opacity

Hey there! I've been playing around with the CSS Opacity Property on a div tag and it's working great. The only issue I'm running into is that when I add text or images to the div, they also become faded. What I really want is for only the b ...

Tips for showcasing an image partially with primefaces/jsf

Looking to display just a single icon from a sprite image? Here is how you can do it using jsf/primefaces: If you tried the code below but ended up displaying the complete image, try adjusting the background-position values: <p:graphicImage value="/re ...

Click to activate the Selectfield option

There are 3 links that populate the select field with various options. When the text label is active and someone clicks on the link selectlist1 or another, it should activate the select label. How can this be achieved? <!doctype html> <html> ...

Unable to view the line number of a CSS style in Chrome Dev Tools while inspecting an element anymore

Today, a strange issue arose that has me puzzled. I can't seem to figure out what caused it. If you take a look at this picture here: This screenshot is from Twitch where I had a tab open. You can see the CSS file and line number displayed as usual. ...

An interesting quirk within CSS is that when a field is hidden, it can

I am currently developing a Chrome extension to modify certain text fields, but I have run into an issue. Specifically, I need to hide the "Stato" field so I implemented the following CSS code: https://i.stack.imgur.com/9blvz.png https://i.stack.imgur. ...

How can you align an icon to the right in a Bootstrap4 navbar while keeping it separate from the toggle menu?

Looking to utilize the Twitter Bootstrap framework for structuring my navbar with distinct "left", "middle", and "right" sections, where the middle portion collapses beneath the navbar-toggler (burger menu) when space is limited. For a self-contained exam ...

JavaScript appends a backslash character to a CSS class

I am attempting to populate index.html with the contents from an array using a JavaScript loop. However, I am encountering an issue where a CSS class for picture formatting is displaying some odd characters when rendered in the latest version of Firefox. ...

Safari browser is experiencing issues with CSS positioning

I am currently working on a website where I am using CSS to position a specific element on the page. The element is absolutely positioned and contained within a relatively positioned parent element. While it displays correctly in Firefox and IE, there seem ...

Creating a shadow effect on a mat-card component in Angular

Working on my project that involves an angular frontend, I attempted to add a shadow effect to one of my components by using class="mat-elevation-z8". Strangely, this did not have the desired effect. This is the HTML code in question: <mat-card class= ...

Aligning the Bootstrap 5 Accordion Button in the Center and Adding Line Breaks

I have a few queries regarding the code I am implementing using Bootstrap 5. JSFiddle How can I center align the header within the button? <button class="accordion-button collapsed text-center" type="button" data-bs-toggle=" ...

The issue of the keyboard disappearing on Chrome for Android while switching between different input

Issue with Input Switching on Chrome for Android I am facing difficulty when trying to switch between two input fields. The HTML code is as follows: <input type="text"/> <input type="text"/> When I enter text in the first input and click on ...

What is the best way to position an image alongside an h2 heading?

Perhaps the technology stack is not relevant in this case, but I am currently working on a nextjs project with tailwind for styling. I am attempting to place an image next to an h2 tag, but encountering unexpected behavior from the image. It seems as thoug ...

Utilizing the Jquery ready method in conjunction with the load function

While utilizing the ready() method to access the DOM, I encountered an issue where jQuery was returning undefined when trying to access an element. Even after nesting the ready() function inside $(window).on("load", function()), there were still instances ...

The note-taking app's JavaScript code does not currently have the capability to store notes in local storage

const noteContainer = document.querySelector(".note-container"); const createBtn = document.querySelector(".btn"); let notes = document.querySelectorAll(".input-box"); function showNotes() { noteContainer.innerHTML = localS ...

Text positioned in the center alongside an image, or if there is limited space, it will be aligned to

Take a look at this code snippet: img { float: left; } #inner { height: 128px; background-color: yellowgreen; display: table-cell; vertical-align: middle; } #content { background-color: red; } <img src="http://cdn.memegener ...

What methods can I use to stop Meta and Title tags from injecting when I import PHP files into an HTML document?

In my PHP document, I took out the Title and Meta tags from the header section, leaving it empty: <!doctype html> <html> <head> </head> <body> <?php require '/DBConnect.php'; //More code here that generates my ou ...

Arrange the navbar on top of the following section

I'm seeking a solution that will achieve the desired outcome without using position: fixed on the navbar, as shown in the following image (I want it to disappear when scrolling down): https://i.sstatic.net/lFW0w.png The image serves as the backgroun ...

External Submit button malfunctioning when attempting to submit two distinct forms

I'm currently working on a program to add items to the cart, and I need to include product attributes like colors and sizes in the process. However, I seem to be encountering an issue where only one form is submitted when using jQuery's submit(), ...

Browsing a website to gather multiple pieces of information from it

About a month ago, I posted a question seeking guidance on how to extract a single value from a webpage. The solution was successful, but then I realized there are numerous stocks out there. After some consideration, I decided to attempt creating a loop fo ...

Activate the textbox without utilizing `.focus()` method

I am encountering an issue with a small iframe on my page. The content within the iframe is larger than the window itself, requiring users to scroll around to view it in its entirety. Within this iframe, there is a button that, when clicked, triggers an an ...