EDITED: Maybe I should ask which selector sets up the side padding when the screen is reduced to below 480px width? I have been browsing bootstrap-responsi
This thread was helpful in finding the solution in my particular case (bootstrap 3)
@media (max-width: 767px) {
.container-fluid, .row {
padding:0px;
}
.navbar-header {
margin:0px;
}
}
The @media query specifically for 'phones' is..
@media (max-width: 480px) { ... }
But, you may want to remove the padding/margin for any smaller screen sizes. By default, Bootstrap adjusts margins/padding to the body, container and navbars at 978px.
Here are some queries that have worked (in most cases) for me:
@media (max-width: 978px) {
.container {
padding:0;
margin:0;
}
body {
padding:0;
}
.navbar-fixed-top, .navbar-fixed-bottom, .navbar-static-top {
margin-left: 0;
margin-right: 0;
margin-bottom:0;
}
}
Demo
Update for Bootstrap 4
Use the new responsive spacing utils which let you set padding/margins for different screen widths (breakpoints): https://stackoverflow.com/a/43208888/171456
Heres what I do for Bootstrap 3/4
Use container-fluid instead of container.
Add this to my CSS
@media (min-width: 1400px) {
.container-fluid{
max-width: 1400px;
}
}
This removes margins below 1400px width screen
The way I get an element to go 100% width of the device is use negative left and right margins on it. The body has a padding of 24px, so that's what you can use negative margins for:
element{
margin-left: -24px;
margin-right: -24px;
padding-left: 24px;
padding-right: 24px;
}
The easy solution is to write something like that,
px-lg-1
mb-lg-5
By adding lg, the class will be applied only on large screens
Another css that can make the margin problem is that you have direction:someValue
in your css, so just remove it by setting it to initial.
For example:
body {
direction:rtl;
}
@media (max-width: 480px) {
body {
direction:initial;
}
}