1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.3 A question about margins (Page Width Controller)

Discussion in 'Styling and Customization Questions' started by petertdavis, Jun 13, 2014.

  1. petertdavis

    petertdavis Well-Known Member

    Is there any way to have the margin a different % depending on what screen size the user has? For example, I want to set the margin to 10% because that's what looks best on my screen. But, I'm using a 15 inch Macbook, but for someone on a 11 inch Macbook air, a 10% margin looks too constricted. How could I use, say, a 5% margin for people on a smaller screen size than i have?
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    Use a media query.

    See the responsive design link in my signature.
     
  3. petertdavis

    petertdavis Well-Known Member

    Thanks for the reply @Brogan

    I was just thinking of another way to approach this. Instead of having different margin, I could set the default 1% margin and set a maximum width in pixels? ie, the site is fluid with a 1% margin until it reaches the width of 1080 pixels?

    Is that easy to do? And if so, what would I put in the Page Width Controller to make it happen?
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

    Use max-width.
    That's how the fluid style on my site is set up.
     
  5. petertdavis

    petertdavis Well-Known Member

    Thanks, so if I put "max-width: 1080px;" into the additional css box in the Page Width Controller it does that but the whole site sits on the left side of the browser on bigger screens. How would I make it centered instead?
     
  6. Brogan

    Brogan XenForo Moderator Staff Member

Share This Page