Set max width for an entire page/section (Wix Studio)

Unless I’m mistaken I can’t find a way to set a max width for the entire page in Wix Studio.

I am using “scale proportionally” as my responsive behaviour type for my sections and it is working well, but is an issue on larger monitors where the elements become too big.

I would like to be able to set a max width for the entire page e.g. 1440px.

Currently I can’t even see how to set a max with for a section when using scale proportionally, even under the “advanced sizing” options (see screenshot).

If anyone knows of a solution, I would love to hear it.

4 Likes

Hey @TobyMcDowell!

At the moment, I don’t believe there is a way to set it directly on the section itself, as a section is by default a full-width element, which can’t be changed.

That being said, there are a few different approaches you could use. Here are a few:

  • Add a container to the section. Use the container as the Parent element for everything in the section, and set the container to have a max-width.
  • Add an advanced CSS grid to the section, and set the min/max width options, so the grid column doesn’t expand beyond a certain measurement.

Let me know how you get on :slight_smile:

2 Likes

Thanks Noah,

A more permanent solution would be ideal as the work arounds you suggested are quite time consuming when creating multiple pages.

I have attempted to set this using custom CSS, but it doesn’t seem to be working:

.page {
    max-width: 1440px;
}

Any suggestions?

I hear you and will pass the feedback on to the teams.

In the meantime, I haven’t much experience with CSS, but it might be possible :thinking:

Let me know if you figure it out!

Thanks Noah,

Is there documentation on what CSS properties can be changed?

As far as I’m aware, it’s pretty flexible in what you can change. Here’s some of the docs we have around it - Styling Elements with CSS - Velo API Reference - Wix.com

Let me know if you need anything else :slight_smile:

1 Like

@TobyMcDowell Did you manage to find a fix for this? Want something similar on my new site - but can’t figure out a way of doing it!

This wouldn’t work because it’s a class try body tag like that:

body {
   max-width: 1440px;
}

Or you can set max width of 1440px for each section you have in your page. And change the background color to something like #FCFCFC which is close to white but not white. (Bad monitors will show it as white btw)

Hi @loeiks, could you please elaborate on your “body” tag suggestion?

I tried to use the body tag you suggested but it doesn’t existing as a global class.

To reiterate my issue, I can’t find a way to set a max width for the entire page.

Thank you

Any updates here @TobyMcDowell ? This should be fixed asap

Hi @didrik, unfortunately there have been no updates.

Man I feel so bad that I forget to reply to this post sorry for a 20days delayed reply but I really forgot it…

Here is the solution (don’t forget to mark it as a solution if it works) add this CSS code to your global.css file:

@media screen and (min-width: 1441px) {
  .section {
    max-width: 1440px;
    left: calc((100vw - 1440px) / 2);
  }
}

This CSS will effect every section you’ve added in your site so it will limit the section width. I have added one more thing (left) to center the section because it’s left side aligned.

If you want to also limit your footer and header you can add this CSS:

@media screen and (min-width: 1441px) {
  .section, .header, .footer {
    max-width: 1440px;
    left: calc((100vw - 1440px) / 2);
  }
}

And here is a demo of this: Home | Tests (wixstudio.io)

I will probably delete this demo site soon. (in 1 week)

5 Likes

Thanks, this is a step in the right direction, but has created two issues as I have my elements set to scale proportionally.

  1. I have my sections set to scale proportionally which works well up until 1440px. But when the max width is achieved, the height of the section continues to increase which isn’t ideal. Is there a way to stop the height of the section from increasing past 1440px as well so both are locked at the same width/height ratio?

  2. My text elements are also set to scale proportionally which means that they continue to increase in value beyond 1440px. Is there a way for their value to also be set as a fixed value above 1440px?

For 1st question:
You can also set max-height like width in the same block of CSS:

@media screen and (min-width: 1441px) {
  .section, .header, .footer {
    max-width: 1440px;
    max-height: 500px; (change 500px to whatever you want)
    left: calc((100vw - 1440px) / 2);
  }
}

For 2nd question:
You shouldn’t use scale system in Studio with this max width and heigh because I don’t think you can fix it instead use advanced sizing and set custom sizes. (I also didn’t like this scale thing it’s not working well) Even if there is a solution I don’t know about it.

1 Like

Hi,

Thankyou for this, this is definitely so far the most helpful solution.

Is it possible to centre the design? The code seems to align my entire design left?

The code I have pasted should fix that issue. That’s why I have added “left” in CSS code.

Can you share your site/page URL to let me check?

Thanks,

Sorry for the delay responding to you. I got caught up in some project work.

I think this solution is the best we have and it works well when not using scaling.

Hopefully Wix can provide support for this when using scaling.

Thanks again for your help @loeiks!

Great!

I don’t think Wix will be able to create a solution for that when you are using scaling. But it will work with advanced sizing as you said.

Hello. Thank you for your solution. This is very helpful.

I have added an anchor menu to my home page using your solution. Any ideas why the anchor menu is outside of my website? I have set my max width size to be 1280px.

My website is here:

Any insight is appreciated.

Simon

Thank you very much for the fix. It works perfectly.