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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T12:09:28+00:00 2026-06-08T12:09:28+00:00

How can I create a nested Bootstrap layout with padding in one of the

  • 0

How can I create a nested Bootstrap layout with padding in one of the sections?

An illustration is below. If I wrap #main-container in a Bootstrap div with .span12, it works. But that means that #main-content is now 40px thinner than the .span12 width, which means I can’t use the Boostrap grid inside of it. (For instance, it’d be great to make #left-column a .span9 and #right-column a .span3, but I can’t.)

Is there a better way to create this layout?

Layout illustration

  • 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-08T12:09:29+00:00Added an answer on June 8, 2026 at 12:09 pm

    I think it really depends on what you want to achieve with the padding.

    For instance, if you want a background in the space provided by the padding, you most certainly need an actual padding. But if on the other hand you just want some spacing, you should be able to stick to the original grid (giving margins to the .span children instead of their container).

    Based on your layout, the fluid solution is obviously more adaptable and easier to implement.

    Takes advantage of the fluid grid inside the padded element : Demo (jsfiddle)

    <div class="container">
        <div class="row">
            <div class="span12" id="header">#header</div>
        </div>
        <div id="main-container">
            <div class="row-fluid">
                <div class="span12" id="main-content">#main-content</div>
            </div>
            <div class="row-fluid">
                <div class="span9" id="left-column">#left-column</div>
                <div class="span3" id="right-column">#right-column</div>
            </div>
        </div>
    </div>
    

    Update Added a more explicit border and background : Border demo (jsfiddle)

    #main-container {
        padding: 20px;
        border: 3px solid red;
        background: yellow;
    }
    #main-container > .row-fluid { background: white; }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to create nested sections in my Web.config file, i can't find any
Given an arbitrarily nested data structure, how can I create a new data structure
One can create an anonymous object that is initialized through constructor parameters, such as
I was wondering how we can create nested repeater control dynamically? I want to
Can I do nested templated with more than one hierarchy in for example kockoutjs
I am trying to create some nested divs where the middle one should have
My aim is to create nested resources via one REST request. The REST requests
I know you can create easily nested lists in python like this: [[1,2],[3,4]] But
Im programming in C#.NET. I want to create a nested class that can access
How can I create a nested structure in VBA? When I try the following

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.