Arrangement of Divs in Bootstrap 3 for Desktop and Mobile Devices

Perhaps this visual aid can clarify my goal:

Considering that the blue block signifies a basic list, my idea is to duplicate the block and assign a "desktop-only" and "mobile-only" class to each one, utilizing these classes to control visibility. However, I am interested to know if achieving this effect is feasible with just HTML/CSS using Bootstrap 3?

Answer №1

Try this solution:

<div class="row">
    <div class="col-md-4">First</div>
    <div class="col-md-8" id="large">Large</div>
    <div class="col-md-4">Second</div>
</div>

Also, apply the following CSS:

@media (min-width: 769px) {
    #large {
        float: right;
    }
}

For a live demonstration, check out this example: http://jsfiddle.net/8r4g20cr/1/

Answer №2

Considering the layout you have, it might be possible to achieve the desired effect with the following code:

<div class="row">
  <div class="col-md-4">
    <div class="marron"></div>
    <div class="blue"></div>
  </div>
<div class="col-md-8">
  <div class="green"></div>
</div>
</div>

By resizing the screen, the divs within the rows should stack up accordingly. It may not be possible to change the order for mobile devices at this time. Keep an eye out for any alternate suggestions.

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

Bootstrap button groups do not support the checking functionality of radio buttons

My bootstrap modal contains a form with two radio style buttons created using the example for normal button styled radio options found here: <form id="changePlanForm" action="/change_plan_submit.php" method="post"> & ...

What is the best way to place a horizontal line behind buttons in a design?

Hello, I was experimenting with creating a background line behind the buttons on my webpage. Previously, I used an image for this purpose but now I want to achieve the same effect using a line. <div class="feedback-option"> <div class="radios2" ...

Combining LESS with cultural designations

Currently working on a multi-lingual website project and facing the challenge of switching out CSS based on different languages. I am passing the culture code into the page and exploring ways to use it to reference specific selectors for each language. H ...

Unexpected problem with redrawing HTML application in Android WebView

I created a basic nixie clock app using HTML and wrapped it in a WebView for use on Android. It consists of one HTML file, a JS file, a CSS file, and ten digit images. After a few hours, I noticed stripes appearing in the center of the screen where the an ...

Guide on hosting two html pages on a NodeJS server

Currently, I am in the process of learning NodeJS and Javascript with a goal to construct a basic server that can host 2 HTML pages. One page should be accessible via localhost:3000/index, while the other can be reached through localhost:3000/about. While ...

What is the best way to create rounded thumbnails with the paperclip gem?

I noticed that the latest version of Basecamp is implementing this feature, you can check it out in this link. I am curious about how to replicate this in my Rails 3 application. ...

Issues with toggling the menu on Angular 14 using Bootstrap 4.6

I am struggling with implementing a menu on the header section of my Angular 14 homepage. The menu I added is not opening as expected. Even after trying various working menu samples from the internet, I couldn't get it to work in my project. Here are ...

What is the process for updating the h1 header with text entered into an input field?

I'm working on an assignment that requires me to change the h1 heading to reflect whatever is entered into the input field. To accomplish this, I need to create a function using getElementByID. Here's what I've done so far: <!DOCTYPE htm ...

Encountering an undefined variable error with Ruby on Rails 6 Bootstrap after restarting the server

I'm facing an issue in rails 6 where upon server restart, I encounter an Error: Undefined variable. Oddly enough, if I comment out the SCSS variables in my files, refresh the page, then un-comment them and refresh again, everything works as expected a ...

Creating personalized fonts in SAPUI5 Theme Designer

Recently, I have been working on creating a personalized theme for the HANA cloud platform Portal. In order to give my site a unique touch, I decided to incorporate custom fonts. To achieve this, I uploaded the fonts as an HTML application in HCP. Now, my ...

Interacting with a span button within the parent element using its specific id with Selenium and Java

Can I click on a span button nested within a div element and use the input's id to ensure test stability? HTML: <div class="idit-go"> <input id="IDITForm@checkRuleVO" class="GoLong align-left idit-go-text" type="text" value="" title="Valida ...

Learn how to activate a JS native event listener using jQuery for the 'change' event

This question is unique from the one found at How to trigger jQuery change event in code. The focus here is on the interaction of jQuery with native event listeners, rather than jQuery event listeners. I am using addEventListener to bind a change event fo ...

Tips on crafting tailored CSS styling for targeted div elements such as before and after:

Looking to style specific div elements with the same class name? <div class="main"> <div class="banner_image"> banner 1</div> <div class="banner_image ">banner 2</div> <div class="banner_image ">banner 3</di ...

Click event from Angular Material menu is triggered twice on mobile devices

After implementing a basic angular material side menu from the demo, I noticed that all click events are being fired twice on the entire page when viewed in mobile browsers. This issue can even be replicated in the Chrome emulator. (To reproduce, enable th ...

Verify the dropdown selection when moving focus away from it

I need help validating my DropDownlist on tabout. Here is the code for the dropdownlist: <div class="form-group"> <label class="col-sm-2 control-label labelfont">Select a Provider Type:</label> <div class="col ...

Retrieving Files using Ajax Across Different File Types

I recently came across the following code snippet: DOM_imgDir = "img/UI/DOM/"; fileextension = ".jpg"; $.ajax({ url: DOM_imgDir, success: function (data) { $(data).find("a:contains(" + fileextension + ")").each(function () { filename = thi ...

Ajax TabContainer mysteriously vanishes during Postback

I'm currently working on a GIS web application using C# ASP.net. Within my project, I have an Ajax TabContainer that houses multiple TabPanels containing various elements like a map window and scale bar from the ESRI WebAdf toolkit. Below is a simpl ...

When it comes to using brackets and HTML, I keep receiving an error message indicating that there is no index file

I'm having trouble with this code - it works fine in Code Academy, but I am new to HTML and trying to practice outside of the platform. Every time I try to live preview in Brackets, I get an error message saying "make sure there is an html file or tha ...

What is the best way to transfer form input data from a child component to the parent component in React?

Recently delving into the world of React, I decided to experiment with forms. My project idea was straightforward - create a form component with input fields that, upon clicking submit, would pass the input values to the parent component ('App') ...

Using the mouse scroll to activate the $anchorScroll effect in Angular instead of a click

I have been searching for a solution to my problem without any luck so far. Hopefully, someone here can provide guidance and help me find a solution. My goal is to replicate the behavior shown in the second example on the following page: https://docs.angu ...