As a complete beginner in coding and web development, I'm facing a problem that I need help solving:
I attempted to insert an image into the column within my Bootstrap 4 grid layout. However, upon adding the image, a horizontal scrollbar mysteriously appears on the screen, causing confusion.
This screenshot illustrates the issue: https://gyazo.com/c383ecb9180181349363e0636047867c
<div class="container">
<div class="row">
<div class="col-6">
Lorem ipsum dolor sit amet, consectetur adipisicing elit.
</div>
<div class="col-6">
<img src="https://images.unsplash.com/photo-1585600270404-543d0eac85e1?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=3042&q=80">
</div>
</div>
The second issue arises when I attempt to resolve the initial problem by using the "img-fluid" class for the image. Although this removes the horizontal scrollbar, switching the container to container-fluid to cover the full width of the screen while utilizing the "px-0" class to eliminate extra padding results once again in pesky horizontal scrollbars appearing.
<div class="container-fluid px-0">
<div class="row">
<div class="col-6">
Lorem ipsum dolor sit amet, consectetur adipisicing elit.
</div>
<div class="col-6">
<img class="img-fluid" src="https://images.unsplash.com/photo-1585600270404-543d0eac85e1?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=3042&q=80">
</div>
</div>