3 Offset Columns in Bootstrap 1.5

I'm currently brainstorming a Bootstrap 3 grid design that features a top row with 4 columns and a bottom row with 3 columns centered against the first row like this...

https://i.sstatic.net/e1V62.jpg

Although I've considered using offsets, utilizing a left offset of 1.5 columns for the bottom row has proven to be problematic.

Does anyone have a working example similar to what I am trying to achieve?

Answer №1

I created a layout similar to an org-chart using the following structure:

HTML

<div class="container">
    <div class="row">
        <div class="col-md-3 box">
          Column
        </div>
        <div class="col-md-3 box">
          Column
        </div>
        <div class="col-md-3 box">
          Column
        </div>
        <div class="col-md-3 box">
          Column
        </div>
    </div>
    <div class="row center-boxes">
        <div class="col-md-3 col-md-push-1 box">
          Column
        </div>
        <div class="col-md-3 col-md-push-1 box">
          Column
        </div>
        <div class="col-md-3 col-md-push-1 box">
          Column
        </div>
    </div>
 </div>

CSS

.container{
    background:#ccc;
}

.box{
    background: gray;
    height:50px;
    text-align:center;
    padding:15px;
    border:1px solid black;
}

.center-boxes div{
     margin:0 -4% 0 4%;
}

*Please note that this layout is designed for desktop view, adjustments may be necessary for smaller devices until reaching col-xs-12, after which the offset (push) won't have an effect

Media query adjustments should also be made at 1024px and 991px with the margin:0 -4% 0 4%;

Feel free to check out the working demo 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

Cannot utilize Map within each loop

Below is the less code snippet: @threshold:{ a:50; b:200; }; @themes:{ a:red; b:blue; }; .mymixin(@name,@color,@thrshld){ //do-something } each(@themes,{ .mymixin(@key,@value,@threshold[@key]); }); Upon executing the code, an error message ...

Please provide an explanation for the statement "document.styleSheets[0].cssRules[0].style;"

I'm seeking an explanation for this block of code: document.styleSheets[0].cssRules[0].style; It would be helpful if you could use the following code as a reference: * { padding: 0; margin: 0; box-sizing: border-box; font-family:&apos ...

What is the best way to showcase an array of objects in a table with two columns?

Looking to showcase an array of objects in a table with 2 columns. What's the simplest way to achieve this display? const columns = [ { subHeading: "A", subText: ["1", "2"] }, { subHeading: & ...

Why is my React build's index.html coming up empty?

I've been working on a React app using Snowpack, and everything seems to be in order. The build process completes successfully, but when I try to open the index.html file from the build folder, the page appears blank. To temporarily resolve this issu ...

Switching from a layout of 3 columns to 2 columns on iPad when orientation is changed to portrait

Apologies for posting this inquiry here, but I am facing a challenge with an iPad issue when switching to portrait orientation on my website. I am using a @media query to detect the portrait view and I want to switch from three columns to two. However, th ...

Place the division at the bottom of the screen

I'm facing an issue where I am trying to place a div at the bottom of the viewport but it's not working as expected. Here is how my current setup looks like: html <div class="parent"> <div class="bottom"> </div> </div&g ...

Utilizing Playframework in Scala to Connect a List/Sequence to the Controller

I am struggling to connect a list of input items on my webpage to my controller. This is how my form is defined: def clientForm = Form( tuple( "clients[]" -> seq( tuple( "firstname" -> text, "lastname" -> text) ) ) ...

The current page I'm working on is scrolling sideways, but I prefer a stationary layout without any scrolling

I am currently facing an issue with my webpage scrolling to the right. This behavior is not acceptable as web pages are not supposed to scroll to the right, correct? Could someone assist me in eliminating this unwanted scroll from my page? I have only u ...

Scraping: Previously scraped links can no longer be retrieved for dumping HTML files into a designated folder

My current project involves using Python, Selenium, Sublime, and Firefox to scrape links from a specific website. I want to save the scraped pages as HTML files into a designated folder. Unfortunately, I've encountered challenges in getting the body o ...

Is it possible for a navbar in CSS to collapse based on its width?

At the moment, I am utilizing Bootstrap v3.3.6 and jQuery v1.9.1. My current project involves a horizontal navbar that collapses once it reaches a specific screen resolution. I am pleased with how this feature operates and wish to maintain the same breakpo ...

Alter numerous classifications based on varying circumstances at regular intervals

This code snippet is designed to change randomly all the <div class="percentx"> elements, for example from <div class="percent31"> to <div class="percent52"> (with values between 1-100). It works smoothly. I ...

Tips for concealing an entire row of a table with Jquery

I am currently working on a system that involves a table with anchor tags named original and copy in each row. By clicking on these anchor tags, we are able to update the database whether the item is an original or a copy using ajax. However, I am facing a ...

Using jQuery to toggle the visibility of divs depending on the selection of multiple checkboxes

I found this code snippet that I need help with. <div class="row"> <div class="col-xs-4"> <label class="checkbox-inline"><input type="checkbox" value="draft">Draft</label> </div> <div class="c ...

Is there a way to align two links side by side, with one on the left and the other on the right?

<a href="example"><p style="text-align:left">Previous Page</a> <a href="example"><p style="text-align:right">Next Page</a> I am trying to figure out how to align these links on the same line. Any suggestions would be a ...

Challenging jQuery AJAX journey

After tirelessly searching the web, I am still unable to solve this issue and cannot understand why it is not functioning. My JavaScript code seems to work only on Firefox and fails to run on any other browser. So, I have made the decision to switch to j ...

Creating sequential numbers using jQuery

Recently, I worked on a script (credit to Chyno Deluxe) that generates a list of menu items based on what is written in the input box. However, I now have a new requirement which involves generating a sequence of numbers to be added continuously. Here is ...

Confusion arises when using Materialize CSS for selecting elements

Currently, I am working on an app using Cordova. Within this project, I have incorporated jQuery Mobile's CSS and JS along with Materialize CSS and JS. However, I recently encountered an issue after integrating the Materialize files. Specifically, whe ...

javascript An interactive accordion component created with Bootstrap

I have been searching for a solution to create an accordion-style collapsible set of panels where the panels remain separate and do not have headers. I want buttons on one side, and when clicked, a panel is displayed on the other side. Only one panel shoul ...

Creative Vue.js and Tailwind CSS card layout featuring an image extending beyond the boundaries of the card

I'm attempting to design a card where an image pops out of the card. I've tried using z-index, but it doesn't seem to be working as expected. Here is the code I have: <div class="flex flex-col"> <div class=&quo ...

Is there a way to make a div element clickable?

I have attempted to include a link (href) in the cart-button class using the following HTML code: <div class="cart-button" href="#shopping-cart" alt="view-shopping-cart"><span>Shopping Cart (0)</span> <div class="cart-dropdo ...