I don't use it all the time, but this one comes in handy when you need something to go full width but you're confined by a container it's already in. For example, an article where you want full width images, but fixed width content.
.breakout { margin-left: calc(-50vw + 50%); margin-right: calc(-50vw + 50%); }
First time I've seen this solution!
I usually see two variants:
<div class="container">...</div> <img class="full-width" ... /> <div class="container">...</div>
.container { padding: 2rem 1rem; } .breakout { margin: 2rem -1rem; }
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I don't use it all the time, but this one comes in handy when you need something to go full width but you're confined by a container it's already in. For example, an article where you want full width images, but fixed width content.
First time I've seen this solution!
I usually see two variants: