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

The Archive Base Latest Questions

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

What is the best way to apply a border and padding to a containing

  • 0

What is the best way to apply a border and padding to a containing site wrap div to a site using a grid system like twitter-bootstrap ?

Using bootstrap for example – the grid depends on being within nested containers and rows. Applying a border and padding to the 1st container changes the maths and the contained divs stack vertically – the grid breaks.

placing the 1st container in a seperate wrap div and applying border & padding to the wrap div doesn’t work either – the contained divs break out of the container.

so an example of the mark up is:

<div class=' main'>
    <div class='container'>
      <div class='row'>
        <div class='span12'>              
            <h1>Demo</h1>    
            <div class='row'>
              <section class='span8'>
                blah blah
              </section>
              <aside class='row'>
                links n stuff
              </aside>    
             </div>
         </div>
      </div>
</div>    

and i want to apply a 20 px padding, 1px border to the main wrapper. Bootstrap calculates the widths of spans in px’s – so they are breaking out.

  • 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-11T01:42:04+00:00Added an answer on June 11, 2026 at 1:42 am

    so we don’t want px widths, we want % widths. Other frameworks use %’s. oh. bootstrap fluid uses %’s

    <div class=' main'>
    <div class='container-fluid'>
      <div class='row-fluid'>
        <div class='span12'>              
            <h1>Demo</h1>    
            <div class='row-fluid'>
              <section class='span8'>
                blah blah
              </section>
              <aside class='span3'>
                links n stuff
              </aside>    
             </div>
         </div>
      </div>
    </div>    
    

    and then work out the width of the container using media queries

    .main{
      width:1210px;
      margin:20px auto;
    
      border-radius:3px;
      border:1px solid #eee;
      box-shadow: 2px 2px 8px rgba(6,6,6,0.5);
    }
    
    
    @media (max-width: 1210px) { 
     .main{
        width:80%;
      }
     }
    

    and thats a box around the bootstrap grid. yay.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using just CSS (and JS to apply :hover styles), what's the best way to
Potentially dumb: Assuming I have a string containing an operator what's the best way
I want to apply class=active depending what page you on. What the best way
Im wondering which way of using OOP in Javascript ist best way to go
What's the best way to save my MySQL data model and automatically apply changes
What is the best way to manage property sets to apply to EJB, and
What is the best way to apply a simple patch to a Ruby gem
I just started using Twitter Bootstrap, and I have a question about how to
I just wonder what's the best way to apply a function that returns Void
I'd like to hear some thoughts on the best way to optimize our schema

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.