Bootstrap responsive container
bootstrap question
I currently have my container set up like this but does anyone know a way using bootstrap how to make sure the image does take the full fluid width?
as shown in the image

62 Replies
what do you want the image to do?
atm the image takes the size of the container, but I want the width to stretch out to the viewport edge.

like this from the design

I already had a solution but the text doesn't align with the other text on the page which uses the bootstrap containers
basically, you want the image to leave the container?
ye, havent really found a class for that. I mean you have container-fluid but it doesnt'seem to work as expected when I put it on the div where the col classes are
i honestly forgot how it used to be done, but was a massive pita
i don't think there is one for that on bootstrap
ye...
no, but there are tricks to make it happen
How do you even call this? cuz idk what to look for..
escape the container
but i have an idea for you
this is pseudo-code:
I fixed it lol
apparently it was as simple as adding display block and width 50vw
uh not quite nvm
lol
it works here

you should set an aspect ratio
the image is stretched
but not here

the aspect ratio is already set in twig tho?
is it set in css?
it doesn't change anything if I add it in css.
the images don't look stretched tho
if you remove the height, it will
no?

the object-fit: cover was already there
you're setting the wrong aspect ratio
that can't be 1:1
idk what you're talking about tho, I get it from the aspect ratio but not the stretched image.
if you hover the url, what does it say?

the rendered size is different the the actual size, I think this is the case with all my images.
you should set an
aspect-ratio: 1/1
Could not use bootstrap for this section and then just use grid. My 2cents
I found a fix on Stackoverflow actually. He did some calculations with left and right using position relative.
For those curious this is what they did. it respect the bootsrap container but visually it will appear the way I want.
use margins instead
if you want it for the other side then do the same for left as you did with right and set right to 0
position relative can mess with position absolute elements
nah it works I leave it at that.
margin works too
my sections are seperate from each other and this section doesn't use any position absolutes
same exact code, except it's margin-left
if the switch is that easy I will try it.
you don't need to specify anything else
it is
remove the position and the right
rename left to margin-left
okay I changed it to that thx
you're welcome
really wish that bootstrap had a class to break out the container to do stuff like this
yeah, but it isn't made for that
container-break or something
but would be nice
fuck, I just noticed the images on the right causes an overflow
I did a overfow-x: hidden on the body if there are other solutions they're welcome
use 100dvw instead of 200%
is dvw supported baseline?
wait uh, the overflow only happens when I am not in inspector mode
you can do this:
(100dvw - <size you want>) / 2
that just breaks the styles
do this
i saw it in other places
the
<size you want>
is the width of the container
I am doing this on my even section blogs, but there is still a overflow
you're doing 0 / 2
-1 * 0 / 2 is 0 / 2 which is ...
even if I change the second dvw to another value it still hits me with the overflow
did you remove the 8px margin in the body?
wdym?
by default, the body has 8px of margin
or padding or whatever
I have this?
ew
but yeah, that work
i have a visceral reaction to that reset
why?
because it serves no purpose
you remove all the margins and paddings, to then add them all back
usually, to the exact same values you just removed
when I remove the box-sizing nothing changes tho