SOLVED: Max-width acting like Width

Bricks Version: 1.4
Browser: Brave
OS: Windows
URL: https://screen.matriarch.ie/app/play/54pdbcw8#sqMXZtM1

Setting up a max-width for a .boxed class seems to act like a fixed width

(also, on the video, on this page, I have a top and bottom positioned div of 10px that appear a lot wider in the builder - not in the frontend - this was not the case in 1.3.8)

Thanks for the amazingness of Bricks, such a pleasure to work with it
Jo

Hi Joa,

The thing is by default, containers are:

max-width: 100%;
width: YOUR_CONTENT_WIDTH; /* (1100px by default if I remember well) */

So if you set max-width: 992px, in the end you have:

max-width: 992px;
width: YOUR_CONTENT_WIDTH;

And yes, it acts as fixed width and overflows since you don’t have the 100% protection.

The solution in this case is just using width instead of max-width to keep 100% max :wink:

4 Likes

thanks a lot! that makes sense!

So if you wanted to make a container, not the usual width, and say 900px instead of 1100px set in bricks - you would use the width field not max width?

Trouble being then it’s not responsive is it at all? As you’ve set the width instead of it being 100%?

I’ve been using max-width lately and I swear never had issues before, but my content is overflowing responsively with it.

1 Like