I have an image inside a (Bootstrap) container and I want the image to be 100% width of the page. I can't take it outside of the container and I can't take away the padding of the container (because of the texts around the image).
I found that I could give the image position: absolute
, but I have subtitles ON the image, and when I do that the subtitles won't be on top of it anymore.
Are there any other solutions to force the image to "ignore" the padding of the container it is inside?
Edit:
.cooking {
width: 421px;
border: 0px solid;
border-color: #779a0b;
border-top-width: 20px;
margin-top: 8px;
}
@media(max-width: 768px){
.cooking {
margin-left: -15px;
margin-right: 15px;
width: 787px;
}
}
<div class="container">
<div class="row">
<div class="col-md-7">
<p>
some text
</p>
</div>
<div class="col-md-5 test">
<img src="img/studenten-breiter.jpg" alt="Studenten beim Kochen" class="img-responsive cooking">
<div class="img-titel">
<p>
subtitles
</p>
</div>
</div>
</div>
<--! some more stuff -->
</div>