I’m working on a project where I wanted to use the twitter bootstrap responsive css scaffolding, but ran into a bit of a snafu because I needed to add a border and background to the container class.
I decided to extend the @media responsive stylesheet declarations to achieve this. The padding is not quite as much as I would like, but its better than having the span divs right up on the edges of the container div and I’m too lazy to edit all the span widths.
.container, .navbar-fixed-top .container, .navbar-fixed-bottom .container { width: 940px; padding: 10px; border:1px solid #cecece; border-top:0px none; background:#fff; } @media (max-width: 767px) { body{ padding-left: 0px; padding-right: 0px; } .container{ padding:5px 19px; width: auto; } } @media (min-width: 768px) and (max-width: 979px) { .container, .navbar-fixed-top .container, .navbar-fixed-bottom .container { width: 724px; padding:10px 14px; } } @media (min-width: 1200px) { .container, .navbar-fixed-top .container, .navbar-fixed-bottom .container { width: 1170px; padding:10px 14px; } } |
Hey man, thanks for the tip. Can you tell me if you put this extension code straight into bootstrap-responsive.css, or do you put it in your own file for inclusion afterwards?
No problem =) I just put this in my own stylesheet included after bootstrap css which overrides those style declarations.
Great solution