0

How can you force a col to expand to the full width on right which is inside a container

<div class="container">

    <div class="row">

      <div class="col-5">

        Lorem ipsum
      </div>

      <div class="col-7 img-col">
         <img class="img-fluid" src="https://placeimg.com/640/480/nature/sepia"/>
      </div>

    </div>

  </div>

I've tried to use position absolute on the right col but isn't going to stretch to the left

https://jsbin.com/cikuragaba/edit?html,output

anaxy
  • 29
  • 5

3 Answers3

0
.container {
  position: relative;
}

.img-col {
  position: fixed;
  right: 0px;
  width: 100%;
  top: 0;
}

.img-fluid {
  width: 100%;
}

This will set it to the full width but if you explain what you're trying to do I think there will be a better way than this to achieve it.

0

I believe that the div is already at full width, but the image is not. Add this CSS:

.img-fluid {
    width: 100%;
}
Kevin Vandy
  • 401
  • 3
  • 10
0

Use:

.img-col .img-fluid {
     width: 100%
}

This will make your image within the img-col 100% width. .img-fluid only specifies the max-width. Being specific with .img-col first doesn't make ALL .img-fluid 100% width.

Howard E
  • 5,454
  • 3
  • 15
  • 24