Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7603773
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:44:22+00:00 2026-05-30T23:44:22+00:00

Using Twitter’s Bootstrap’s standard 940px fluid grid responsive grid I’m trying to get multiple

  • 0

Using Twitter’s Bootstrap’s standard 940px fluid grid responsive grid I’m trying to get multiple .span div’s in one .row.

I want to show a max of 3 .span‘s on each internal line that grows with the page. So as more .span’s are added they just get added to the .row.

<div class="navbar navbar-fixed-top">
  <div class="navbar-inner">
    <div class="container-fluid">
      <div class="span4">1</span>
      <div class="span4">2</span>
      <div class="span4">3</span> 
      <div class="span4">4</span>  <!-- wrap to a new line-->                
      <div class="span4">5</span>    
    </div>
  </div>
</div>

The problem I’m facing is that the span4 which wraps to a new line has the inherited left margin. While I can fix this with nth-child() in modern browsers, it obviously still affects IE.

Any ideas how I can achieve this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T23:44:23+00:00Added an answer on May 30, 2026 at 11:44 pm

    I decided to use the nth-child selector to remove the margin on certain .span’s. So my final solution looked likes this:

    One column of spans for 320px to 979px

    Two columns of spans for 980px to 1409px

    Three columns of spans for 1409px and up

    @media (min-width: 320px) and (max-width:979px) { 
        /* one column */
        .row-fluid .span4 {width:100%}
        .row-fluid .span4 {margin-left:0;}  
    }
    
    @media (min-width: 980px) and (max-width:1409px) { 
        /* two columns, remove margin off every third span */
        .row-fluid .span4 {width:48.717948718%;}
        .row-fluid .span4:nth-child(2n+3) {margin-left:0;}
    }
    
    @media (min-width: 1410px) { 
        /* three columns, .span4's natural width. remove margin off every 4th span */
        .main .span4:nth-child(3n+4) {margin-left:0;}
    }
    

    For IE7 and 8 I set the width of each span to be 48.717948718% (so two per row) in the css – specifically targeting these versions by using html5 bolierplate .oldie html class. I then used Modernizr and a custom test for nthchild found at https://gist.github.com/1333330 and removed the margin for each even span, if the browser does not support the nth-child selector.

    if (!Modernizr.nthchildn) {  
      $('.span4:even').addClass('margless');
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Twitter Bootstrap and at one place I have nested fluid-grid in
I'm using twitter bootstrap . I have a div with 25 px padding. I
I'm trying to create a topbar using twitter bootstrap, but the black bar won't
I got the following code and im using twitter bootstrap. <div class=span10> <div class=span2>@Html.Label(lblUsername,
using twitter bootstrap typeahead i get google chrome suggestion list above typeahead list $(document).ready(function
I'm using twitter bootstrap to develop an app. 2 column layout. One sidebar and
I'm using twitter bootstrap for some web app I'm forced to do (I'm not
We are using twitter bootstrap to do some redesign of our site. The issue
I'm building a website using Twitter's Bootstrap.css. It comes with some helpful preset html/css
I have problem getting the dropdown menu to work using Twitter's Bootstrap. Here's my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.