Arrange column order based on screen size variations

Can Bootstrap or Foundation be used to create this specific layout?

Do you notice the challenge here? The top column needs to switch to the bottom on tablets. The Push/Pull method won't work in this situation as it requires a different type of column reordering.

Any creative solutions come to mind?

Answer №1

The implementation of the CSS `order` property is essential when working with flex-boxes.

For a detailed guide on using the `order` property, visit: https://example.com/css-order-guide

To ensure browser compatibility before using the `order` property, refer to this link:

Answer №2

Utilizing Foundation's size-push-units and size-pull-units classes allows you to fine-tune the positioning of elements based on column units. For instance, using .small-push-10 or .large-pull-7 can adjust the layout by a specified number of columns. It is important to remember to set the opposite classes on relevant elements for proper alignment. In a scenario where each box is 12 columns wide, the green box would have the class small-push-24 (reflecting the total width of all elements pushed past) while the yellow boxes would have small-pull-12 (indicating the width of the pushing element).

For further information, refer to the "Source Ordering" section in the documentation available at

Answer №3

Here is my best attempt at achieving a similar layout: check out example #1.

Whenever I need to arrange columns vertically, I simply assign them a size of 12 (refer to example #2) and let Bootstrap handle the rest. Unfortunately, this approach doesn't seem to work with nested columns. Good luck with your project!

Answer №4

When it comes to dealing with IE8 Support limitations, you have a few options at your disposal:

1.) If the content within these blocks is static (meaning it will stay the same height), you can manipulate the layout using negative margins as a workaround. Check out this example: http://codepen.io/username123/pen/randomlink123

@media screen and (max-width: 600px) {
 .greenTop {margin-top:260px;}
 .yellow1 {margin-top:-360px;}
}

2.) If the green area block isn't too intricate, you might consider duplicating it on the page and toggling visibility based on media queries. Take a look at this demo: http://codepen.io/username123/pen/differentlink456

.greenTop {display:none;}

@media screen and (min-width: 600px) {
  .greenTop {display:block;}
  .greenBottom {display:none;}
} 

(Both of these methods may require something like respond.js to ensure proper functionality in IE8 with media queries. Check out more information here: http://getbootstrap.com/getting-started/#support-ie8-ie9)

Answer №5

Richard Collins, Hey there, take a look at this Fiddle. I utilized Bootstrap and some media query breakpoints to achieve this effect with show/hide features. No push/pull techniques or negative margin values involved, just a simple approach.

For a larger view of the Fiddle, click here.

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
		    ... (The content continues) ...
</html>

Answer №6

Implementing this layout in Foundation involves utilizing nested columns and specific ordering classes. It's important to note that hidden columns need to be the same height as the visible blocks.

<div class="row">
    <div class="large-8 medium-12 columns gr">
        -
    </div>
    <div class="large-4 large-reset-order medium-6 medium-push-6 small-6 small-push-6 columns">
        <div class="row">
            <div class="large-12 medium-12 small-12 columns hide-for-large-only hide-for-xlarge-only">
                &nbsp;
            </div>
            <div class="large-12 medium-12 small-12 columns hide-for-large-only hide-for-xlarge-only">
                &nbsp;
            </div>
            <div class="large-12 medium-12 medium-push-12 small-12 small-push-12 columns gre">
                green
            </div>
        </div>
    </div>
    <div class="large-4 medium-6 medium-pull-12 small-6 columns">
        <div class="row">
            <div class="large-12 medium-12 small-12 columns ye">
                1
            </div>
            <div class="large-12 medium-12 small-12 columns ye">
                2 
            </div>
        </div>
    </div>
</div>

Check out the demonstration here:

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

Identifying page elements in Protractor when they lack obvious identifiable properties

Scenario Here is the HTML code snippet using an Angular JS template: <div class="data-handler-container"> <div class="row"> <div class="data-handler" ng-if="dataController.showDistance()"> <p>{{ 'Item ...

Beginning AngularJS by implementing the ng-controller directive

I'm facing an issue while attempting to create a simple exercise. It seems like I may not be calling the controller variable correctly, which is causing me to be stuck. How can I troubleshoot and fix this code? The output page is displaying: {{dish.na ...

Enjoy a fullscreen Youtube video embed with autoplay using Bootstrap's modal feature

https://codepen.io/JacobLett/pen/xqpEYE I recently watched a YouTube video where tapping on a button automatically played the video. I was impressed, but now I want to take it a step further and have the video play in landscape (full screen) mode when tap ...

Preventing the stacking of numerous animations triggered by jquery events

Hey there! I'm currently working on a webpage and utilizing the Transit library for 3D rotations and other CSS transformations. On this page, I have three links that are set to scale up by 1.2 times when hovered over. Everything seems to be working we ...

Struggling to align button text vertically in the center

I've searched through various sources, including stackoverflow.com and other websites, to solve this problem I'm encountering. Despite trying everything I found, I still can't get the text to center vertically in Firefox when styling buttons ...

`There are two text boxes in a blog post editor within tinyMCE`

https://i.sstatic.net/RVMUO.png I'm currently working on building a blog app using Django. The issue I'm facing is related to the Tinymce editor in the post creation form. Everything works perfectly fine except for one annoying element that show ...

Using Four Different Colour Borders in CSS

Is it possible to create a CSS border with 4 different colors on one side? Currently, I have the following: #header { border-color:#88a9eb; } I aim to achieve a border featuring four solid colors split equally at 25% each. Can this be done? I am looking ...

What steps should I take to properly align these product cards in a grid layout?

I have a grid of items where the first three are perfectly aligned, but the subsequent ones are scattered throughout the webpage. Please see here for an example. I would like to align all cards in the grid similar to the first three. Any help with this wou ...

Capture all div elements from the table and store them in an array

Check out this code snippet that includes draggable divs and a droppable table: http://jsbin.com/exetuk/1/edit When dragging a div to the table, copies of the div with the class .draggable appear. I am looking to create an array with divs from the table ...

Show and hide HTML div elements dynamically using jQuery based on the selection from a dropdown

I am attempting to display or hide various divs based on user input from a select drop-down box. In fact, I initially tried to directly use the code from jQuery dropdown hide show div based on value, but I seem to be missing something simple that is preven ...

Connection between overlay div and corresponding destination div address

I created a linked image with an overlay div: <div class="imageBlock"> <a href="http://www.google.com"> <img src="https://placeimg.com/640/480/any"> </a> <a href="http://www.twitter.com"> <img src="https://pl ...

Are there any "Undefined" tabs hiding in your RMarkdown tabsets?

After knitting my RMarkdown document to an HTML file, I noticed that the tabs appeared as shown below: https://i.sstatic.net/x1p70.png However, when I save and share the document with my audience, I encounter an issue where these tabs are labeled as "und ...

How can you deactivate all form elements in HTML except for the Submit button?

Is there a method available to automatically deactivate all form elements except the submit button as soon as the form loads? This would entail pre-loading data from the backend onto a JSP page while restricting user access for editing. Users will only be ...

Applying a filter within an ng-repeat loop to act as a conditional

Is it possible to use the ng-repeat as a conditional in an efficient and optimal way? I am wondering if there is a way for code to be shown only if found selected is true, without having to create a new variable in the back-end. <div ng-repeat="c ...

"Web fonts without a content delivery network (CDN)

When it comes to loading fonts via CDN, I am facing an issue with the requirements for a specific font. We are currently using Montserrat Light in some sections, but unfortunately, my preference according to Google Fonts does not include the 'light&ap ...

What is the process for converting x and y coordinates to align with a fixed display?

When I make an API call, I am receiving X and Y coordinates in the following format: x: "-0.0120956897735595703" y: "0.147876381874084473" To display these coordinates on my minimap images, I have set their display to be absolute. The "left" and "top" pr ...

Switching between height: 0 and height:auto dynamically with the power of JavaScript and VueJS

Currently, I am changing the height of a container from 0px to auto. Since I do not know the exact final height needed for the container, using max-height could be an option but I prefer this method. The transition from 0 to auto works smoothly, however, ...

Designing websites using elements that float to the right in a responsive manner

Responsive design often uses percentage width and absolute positioning to adjust to different screen sizes on various devices. What if we explore the use of the float right CSS style, which is not as commonly used but offers high cross-browser compatibilit ...

My mobile website, built using Bootstrap, appears as if it is zoomed

I recently launched a website called dekhbehen.com, where users can download wallpapers and generate memes. One issue I have encountered is that when the site is accessed via smartphone, it appears zoomed out. You can visit the specific URL causing this ...

Update the menu-link class to active for a single-page website

Currently, I have a one-page website that serves as a portfolio. The website features a menu at the top with links that direct visitors to specific sections of the page using # as links. I am looking to enhance the user experience by implementing a functi ...