Positioning of a two-column layout that is responsive

Currently, I am working on developing a responsive layout for both desktop and mobile screens using bootstrap 3. However, I am facing issues with the .col-XX-push-X class as the columns are not adjusting their height accordingly.

I aim to create this:

But unfortunately, I am ending up with this:

Below is the relevant section of my code:

<div class="container-fluid">
            <div class="row">
                <div id="campaign-description-section"
                     class="section campaign-description-section col-xs-12 col-sm-12 col-md-push-6 col-lg-push-6">
                    Campaign Description Section
                </div>
                <div id="shirt-styles-section"
                     class="section shirt-styles-section col-xs-12 col-sm-12 col-md-pull-6 col-lg-pull-6">
                    Shirt Styles Section
                </div>
                <div id="color-size-section"
                     class="section color-size-section col-xs-12 col-sm-12 col-lg-push-6 col-md-push-6">
                    Color Size Section
                </div>
                <div id="price-section"
                     class="section price-section col-xs-12 col-sm-12 col-lg-push-6 col-md-push-6">
                    Price Section
                </div>
                <div id="attention-banner"
                     class="section attention-banner col-xs-12 col-sm-12 col-lg-push-6 col-md-push-6">
                    Attention Banner Section
                </div>
            </div>

You can view the full code on CodePen

Answer №1

col-{size}-pull and col-{size}-push, as standalone classes, do not specify any size.

For the desired size, include col-md-6 col-lg-6 in the respective sections.

Answer №2

Here is a suggested approach:

<div id="shirt-styles-section" class="section shirt-styles-section col-xs-12 col-sm-12 col-md-6 col-lg-6">
   Display the Shirt Styles Section here
</div>
<div id="campaign-description-section" class="section campaign-description-section col-xs-12 col-sm-12 col-md-6 col-lg-6">
   Show the Campaign Description Section here
</div>

Answer №3

Since I've never tried using ____-pull, I decided to experiment without it. What are your thoughts on this approach?

<div class="container-fluid">
        <div class="row">
          <div id="shirt-styles-section"
                 class="section shirt-styles-section col-xs-12 col-sm-6">
                Shirt Styles Section
            </div>
            <div id="campaign-description-section"
                 class="section campaign-description-section col-xs-12 col-sm-6">
                Campaign Description Section
            </div>

            <div id="color-size-section"
                 class="section color-size-section col-xs-12 col-sm-12 col-lg-push-6 col-md-push-6">
                Color Size Section
            </div>
            <div id="price-section"
                 class="section price-section col-xs-12 col-sm-12 col-lg-push-6 col-md-push-6">
                Price Section
            </div>
            <div id="attention-banner"
                 class="section attention-banner col-xs-12 col-sm-12 col-lg-push-6 col-md-push-6">
                Attention Banner Section
            </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

What is the best way to position a div in the top right corner of my form using Bootstrap?

I have a form displaying some detailed text about elements in my application. Located outside this form is an "add new item" button that redirects the user to a new page for adding a new item. The current placement of this button is on the upper left corn ...

The color of the element remains unchanged even when hovering the cursor over it

Below is an example of HTML code: <h1 class="one">Hello</h1> Here is the corresponding CSS style sheet applied to it: h1:hover { color: red; } h1.one { color: blue; } When this code runs, the h1 element should turn blue. Ho ...

Issue with the alignment of form input fields and buttons in Mozilla Firefox

Fixing Form Field Alignment Issue in Firefox After encountering and solving a form field alignment issue myself, I realized that the problem persisted in Firefox while displaying correctly in Chrome. Here's how I resolved it, although I am open to mo ...

What methods are available to keep a component in a fixed position on the window during certain scrolling intervals?

I need help creating a sidebar similar to the one on this Airbnb page. Does anyone have suggestions for how to make a component stay fixed until you scroll past a certain section of the page? I am working with functional React and Material-UI components, ...

Incorporate a unique style designation with jquery's .css() method

Currently, I am facing an issue while working with Animate.css. I am attempting to set the duration, delay, and looping options but it seems like the command is not being applied. Upon investigation, I suspect that the propertyName is not being recognized ...

Achieving consistent sizing for React-Bootstrap cards: A guide

In my React app, I am utilizing React-bootstrap and specifically the Card & CardGroup components. I need assistance in ensuring that all the cards have the same height. JSX component: <Card style={{flex: 1}} className="card"> ...

"Enhancing user experience with jQuery hover effects on table

This is an example of the HTML structure: <tr class="row-1 row-first"> <td class="col-1 col-first"> <div class="views-field views-field-field-logo-image"></div> <div class="views-field views-field-field-logo-title"> ...

Positioning Text at the Top alongside the Fresh Twitter Button

Trying to integrate the new Twitter button into a Wordpress template has been a bit of a challenge. I'm aiming to have the text aligned with the top edge of the button rather than being centered within it. The specific code segment responsible for pla ...

Hovering on the division element will only trigger an effect when the mouse

Currently working on designing a navbar, where each button consists of a <div> for the box and an anchor tag for text along with a hyperlink. The challenge I'm facing is changing the color of the div when hovering over it. Adding a :hover pseud ...

Toggle between images in Vue.js when an image is clicked

Hey there, I'm pretty new to Vue and could use some assistance with implementing a certain logic. I have a JSON file that contains information about polaroids I've taken, such as their IDs, names, image names, and descriptions. Here's a sni ...

Arranging a Bootstrap 4 layout with a 5-row dropdown menu alongside three labeled text input fields

I have a large select input field in my form and I want to optimize the space beside it: https://i.sstatic.net/PV0bT.png I prefer not to use a table as it may not display well on mobile devices. What I am looking for is this layout: https://i.sstatic.ne ...

Using absolute positioning for child elements within a table cell division in CSS

Similar Question: Is it possible to position items relatively or absolutely within a display: table-cell? I am working with a display: table layout example. You can view the demo here. In the second panel, there is a #pos div that has a position: abs ...

What is the best way to create a container filled with numerical figures?

If I have the number 445758, and I want each of these numbers to be displayed in their own box like this: https://i.sstatic.net/hBiA4.jpg Can you explain how to achieve this? ...

Adjust the width of an element as its content dynamically shifts

I have a container that contains 6 input fields. Two of them are initially hidden (display: none), but when I click on a checkbox, these two inputs become visible (display: inline). I need the width of the container to adjust and increase when the other tw ...

The HTML website appears to be having trouble scrolling on Android devices, however, it functions properly on both iOS and desktop platforms

Hello everyone, I need help solving an issue with my responsive HTML website. It works perfectly on a desktop browser, but when viewed on a mobile device, it gets stuck and won't scroll. Any suggestions on what might be causing this problem? Thank you ...

How to Create a Bootstrap 4 Fixed Bottom Navigation with a Dropup Feature?

After thoroughly researching the site, I have not found a solution that works with this particular approach. In order to create the following template, I utilized Pingendo. .dropup .dropdown-menu { top: auto; bottom: 100%; margin-bottom: .125rem; ...

Tips for ensuring the list stays perfectly centered within the navigation bar when placed among three images

I have my navigation bar set up with the logo on the far left and two flags for English and Italian on the far right. The issue I'm facing is that the UL element, being a block element, pushes the flags onto the next line. However, I want the UL to be ...

Steer clear of using mouse-over effects and focus highlighting in CSS and jQuery

I am looking to implement a feature where only keyboard navigation triggers row highlighting in a table, rather than mouseover events. When using the tab key to move through the rows, I want the highlight effect to be activated. <table> <tr&g ...

What are the reasons behind the occasional failure of vertical centering using height/line-height?

When it comes to CSS single line vertical centering using line-height, I often run into a problem. My usual approach is setting the height and line-height without padding, particularly for buttons: height: 44px; line-height: 44px; However, there are time ...

Using Jquery to Implement Alternate Row Colors in a Gridview

I'm experiencing an issue with my grid view where the row colors are not behaving as expected. https://i.sstatic.net/BzkdH.jpg When double-clicking on an empty cell in the grid, it should turn green and display "MI". If I double-click on a green cel ...