0

I have this simple Bootstrap footer grid https://www.codeply.com/p/3WPEe7KAUK

 <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
 <!-- foooter -->
    <footer style="background-color: #0198d1;">
    <div class="row">
    <div class="col-4" style="background-color: #0198d1;">
    <span>test</span>
    </div>
    <div class="col-4 text-center" style="background-color: #0198d1;">
    <span>test</span>
    </div>
    <div class="col-4 text-right" style="background-color: #0198d1;">
    <span>test</span>
    </div>
    </div>
    </footer>
    <!-- END foooter -->

I do not understand why it activates the browser horizontal scroolbar and how to remove it.

xKobalt
  • 1,498
  • 2
  • 13
  • 19
gr68
  • 420
  • 1
  • 10
  • 25

3 Answers3

1

I found also another solution

<div class="container-fluid" >
...
</div>
gr68
  • 420
  • 1
  • 10
  • 25
0

It is because you aren't declaring width of row, So I have added col-12 to row then others div set them according to there parent div neither overflow it;
It can be done like this.

<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<footer class="col-12">
  <div style="background-color: #0198d1;" class="row">
                <div class="col-4" style="background-color: #0198d1;">      <span>test</span>
                </div>
                <div class="col-4 text-center" style="background-color: #0198d1;">
                    <span >test</span>
                </div>
                <div class="col-4 text-right" style="background-color: #0198d1;">
                    <span>test</span>
                </div>
        </div>
     </footer>
Ahmed Ali
  • 1,908
  • 14
  • 28
-1

Overwrite the negative margin from <div class="row"> to 0px

Problem:

.row {
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    margin-right: -15px; 
    margin-left: -15px; 
}

Solution

.row {
        display: -ms-flexbox;
        display: flex;
        -ms-flex-wrap: wrap;
        flex-wrap: wrap;
        margin-right: 0px!important; 
        margin-left:  0px!important; 
    }
Dholu
  • 658
  • 7
  • 14