So I'm using bootstrap 4, and have layout which has a container
class:
body
#content.container
.row
.col-6
| Awesome content
.col-6
| I like that
.row
.col-12 And so on
.row
.col-3.here Content with an image
.row
.col-12 And so on
Works really well.
But sometimes, my very-competent-but-not-aware-of-technical-contraints designer adds an image at the level of the .here
class, but positioned on the left of the screen, which means outside the .container
.
The only solution I know for now is to move the .container
outside the layout and to repeat it, like so:
body
#content
.container
.row
.col-6
| Awesome content
.col-6
| I like that
.row
.col-12 And so on
div style="background-image: url(/images/example.jpg);"
.container
.row
.col-3.here Content with an image
.container
.row
.col-12 And so on
This is a pain because it completely breaks factoring, becomes neither DRY, nor responsive.
But do I have a choice?
Of course setting the image position in JS is even uglier. Or setting fixed position of the image isn't a solution either.
But I thought maybe, thanks to flexboxes, it is possible to write something like div.uncontainer style="background-image: url('/images/example')"
that would make the div full width, ignoring the .container
constraint.
Has anyone the same issue? Is there a clean solution?
Thanks