if i have:
<div class="container-fluid"> <div class="row-fluid"> <div class="span8"> Some Element.... </div> <div class="span4"> Other Element </div> </div> </div>
With this code i have some margin from left and right window borders. How can eliminate these margins?
Thanks for your support
So the answer is: . container-fluid > . row -- make the margin:0 on the left and right if you remove the padding on the left and right of the column classes.
As an improvement of this answer, you can easily remove padding and avoid the horizontal scrollbar simply adding the no-gutters class to the row element. This removes the negative margins as stated by the official documentation getbootstrap.com/docs/4.0/layout/grid/#no-gutters. So, no further css rules are needed.
padding-right: 15px; padding-left: 15px; px-0 can remove the horizontal padding from container-fluid and no-gutters can remove the padding from col .
Containers are a fundamental building block of Bootstrap that contain, pad, and align your content within a given device or viewport.
If i understand your question correctly, I believe you want this:
.container-fluid { padding: 0px; }
Also if you are using responsive bootstrap you will also want this:
@media (max-width: 797px) { body { padding-left: 0px; padding-right: 0px; } }
Edit: here is a js fiddle.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With