Edgar Navasardyan Edgar Navasardyan - 1 year ago 55
CSS Question

Adjusting Boostrap container's RIGHT margin

It took me several seconds to adjust left margin on Bootstrap container (narrowing the white blank space on the left side), but now I spent several hours googling to make the same adjustment on the right margin, and so success. Did anyone have idea how to fix it ?

Important note! Ideally, I would avoid editing the original Bootstrap file, and instead put some CSS over the the Bootstrap file. This simple code solved the left margin. I guess, I have to edit the WIDTH of the container, but no idea how to do this in a semantically correct way.



Answer Source

You should use a container-fluid which doesn't have a fixed width. By default it has no margin so you can add it the same way you did for container, or make it a bit more compact:

.container-fluid {
    margin: auto 10px;

If you change the width settings of the container element you cannot use it at it's original intent which is responsive width based on window size.