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 8695519
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:03:31+00:00 2026-06-13T01:03:31+00:00

I am starting with Twitter Bootstrap and have a question about how layout functions

  • 0

I am starting with Twitter Bootstrap and have a question about how layout functions in it. Here is the HTML:

<!DOCTYPE html>
<html>
    <head>
        <title>Bootstrap Test</title>
        <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" />
        <link rel="stylesheet" type="text/css" href="style.css" />
        <script  src="http://code.jquery.com/jquery-latest.js"></script>
        <script  src="bootstrap/js/bootstrap.min.js"></script>
    </head>
    <body>
        <div class="container">
            <div class="row">
                <div class="span4">a</div>
                <div class="span8">b</div>
            </div>
            <div class="row">
                <div class="span12">c</div>
            </div>
        </div>
    </body>
</html>

style.css:

div.container
{
    background-color:#aaa;
}
div.span4, div.span8, div.span12
{
    background-color:#eee;
    border: 1px solid #888;
    border-radius:3px;
}

Adding border to span4 and span8 increases their width and I end up with this:

bootstrap span layout

span4 and span8 get stacked while they should be on the same line. I realize I could decrease their width in my .css file and correct this, or use this:

http://paulirish.com/2012/box-sizing-border-box-ftw/

but does Bootstrap provide means to correct this (not adding extra CSS every time I add or remove border, etc)

  • 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-06-13T01:03:32+00:00Added an answer on June 13, 2026 at 1:03 am

    The span classes in bootstrap have specific widths so adding a border throws off the total for the row and forces them to wrap. To get around this I usually put the border styling on a div inside the div with the span class. Something like this:

    HTML

    <div class="row">
       <div class="span4">
           <div>a</div>
       </div>
       <div class="span8">
           <div>b</div>
       </div>
    </div>
    

    CSS

    .span4 > div, .span8 > div
    {
       background-color:#eee;
       border: 1px solid #888;
       border-radius:3px;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm starting to use Bootstrap from Twitter and needed to add an HTML Select
I have a twitter bootstrap dropdown inside a div with the plugin jOrgChart. The
I'm starting a project with Twitter Bootstrap, and quite like the responsive css, making
I have the following code: window.addEvent('domready', function() { console.log('starting twitter stuff'); var twitter =
I have a modal login window set up using the Twitter Bootstrap framework, exactly
I'm starting a new rails project and added twitter bootstrap (since i've heard good
Starting to learn Canvas and have two classes so far (main one to call
Starting at http://developer.android.com/training/index.html I selected the [ FIRST CLASS > ] button which takes
Starting a new rails project and we have a well-thought-out color palette, and want
I'm starting Objective-C Development and I'm trying to wrap my head around how some

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.