Home>Support>Different background in boxed layout

Different background in boxed layout

Using boxed layout
I want to have different color for background depending on layout inside box.

I would like to have background for header to be black, for slider to be blue, for body to be white etc.
So that bgcolor for page follows the bgcolor inside the box.

As different pages are different layouts (heights) I would like it to follow the box-layout and not hard-code something for each page.

Possible without using wide-layout?

URL: http://samuelhammar.se

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 9 years, 9 months ago Andrew Misplon
    Hi, I Work Here

    Hi Göran

    Thanks for reaching out.

    Not sure I’m following. You might need to explain a little further. In boxed layout as it stands, here is how you can change each one of these elements.

    Overall background:
    Appearance > Customize > Color > Background Color

    Header background:
    Appearance > Customize > Page > Masthead Background

    Meta Slider Background:
    Need to set under Appearance > Custom CSS, insert the below and edit as required:

    /* Meta Slider Background Color */
    
    #main-slider {
    background: #fff;
    }
    

    Body Background Color:
    Also set under Appearance > Custom CSS:

    /* Main Body Background Color */
    
    #main {
    background: #FCFCFC;
    }
    

    Edit as required.

    Footer Background Color:
    Appearance > Customize > Footer > Footer Background

    Can you perhaps explain further what you’d like to be dynamic about this.

  2. 9 years, 9 months ago Göran Johansson

    If you look at my site and compare with http://exmo.se you will see that the page-background is different depending on backgrounds in the box.

    But I thought about it for a second and it feels like it would be not so possible as the content in the box differs between pages.

    Can I use full-wide layout and still show content “in a box”. Does set #Page-Wrapper to a fixed width solve this?

    I’ll wait before I try if you have time to answer, otherwise I will test in a bit.

  3. 9 years, 9 months ago Andrew Misplon
    Hi, I Work Here

    Sorry, I’m still not with you. Are you looking to adjust the opacity of the main container? If so, try the following under Appearance > Custom CSS:

    #main {
    background: rgba(255, 255, 255, 0.5) !important; 
    }
    

    255, 255, 255 is RGB for white (#ffffff;) and 0.5 is 50% opacity.

    In full width content will still be constrained but it won’t have a boxed layout around it, unfortunately.

  4. 9 years, 9 months ago Göran Johansson

    Ok

    If you look at my site it’s now in boxed layout. The main background is grey.
    I want the grey background to follow the background inside the box.
    If you look inside the box you see the menu is black, slider is blue, content is white, footer is black.
    I want the page background to be same so not grey but instead black, then blue, then white, then black. So it follows the bgcolor of what is inside the box.

    Or if that is not possible.
    How can I use the full-width layout and still make the page look like it’s inside a box? I want to limit the content to 917px. Slider is easy but as example force the menu to center on the page and stay within 917px is for me a challenge I haven’t succeeded with yet.

    Hope you understand me now.
    Look at http://www.exmo.se you will see what’s the end goal.

  5. 9 years, 9 months ago Andrew Misplon
    Hi, I Work Here

    Thanks.

    You can do this. You’d need to create an image in Photoshop or similar. It would be a 1px wide image, the 79px would be black, then blue etc. The background image we can then set to repeat-x. So yes, this can be done but not with theme options, you’d need to create the image on your side.

  6. 9 years, 9 months ago Göran Johansson

    But then it would not follow the content of the page so when i scroll the menu sticks in the top but the background will then disappear?
    And as different pages are in different layouts (heights of content) I would need to have one background per page and recreate them if I alter the content of the page?

    I think it’s not possible but I appreciate the help!

    If I use the full-width layout how can I change the menu, slider, content, footer to center on page and be maximum 917px wide?
    I have played with css to find a solution but I can’t manage to get the menu to center on the page, it sticks on the left side all the time. Haven’t tried body and footer yet but I think I will get same issue there.

    Any ideas? Thanks!

  7. 9 years, 9 months ago Andrew Misplon
    Hi, I Work Here

    Ahh right, for sure. It would unfortunately take a decent amount of custom development to run the effect you’re looking for.

    When using the full width layout the content will be constrained, it just won’t have a box around it: http://demo.siteorigin.com/vantage/page-builder/. The width content is constrained to is 1080px.

    Let me try work this up for you quickly. Standby.

  8. 9 years, 9 months ago Andrew Misplon
    Hi, I Work Here

    Ok, so this is pretty much what you’re after, insert into Appearance > Custom CSS:

    body.layout-full {
        background-color: #ccc
    }
    
    .layout-full .main-navigation,.layout-full #main-slider {
        margin:0 auto;
        max-width: 1080px
    }
    
    #main {
        margin: 0 auto;
        max-width: 1010px
    }
    
    .layout-full #colophon {
        background: red;
        padding: 0
    }
    
    .layout-full #footer-widgets {
        background: blue;
        margin: 0 auto
    }
    
    body.responsive.layout-full #page-wrapper #colophon .full-container {
        max-width: 1020px;
        padding: 30px
    }
    

    Appearance > Theme Settings: Layout must be set to full width and sticky menu must be turned off.

  9. 9 years, 9 months ago Göran Johansson

    Great. I will give it try shortly.
    Not possible to still use sticky menu?

    As I want menu, content etc. to all be 917px I just change the widths above to that?

  10. 9 years, 9 months ago Andrew Misplon
    Hi, I Work Here

    Try this rather, will work with sticky menu:

    body.layout-full {
        background-color: #ccc
    }
    
    .main-navigation {
    	background: red
    }
    
    body.responsive.layout-full #page-wrapper nav .full-container {
    	background: blue
    }
    
    .layout-full #main-slider {
        margin: 0 auto;
        max-width: 1080px
    }
    
    #main {
        margin: 0 auto;
        max-width: 1010px
    }
    
    .layout-full #colophon {
        background: red;
        padding: 0
    }
    
    .layout-full #footer-widgets {
        background: blue;
        margin: 0 auto
    }
    
    body.responsive.layout-full #page-wrapper #colophon .full-container {
        max-width: 1020px;
        padding: 30px
    }
    
  11. 9 years, 9 months ago Andrew Misplon
    Hi, I Work Here

    Where I’ve stated 1080px, only there can you change it to 917. Where I’ve said 1020, you need to make that 917 – 60 and where I’ve said 1010 you need to make it 917 – 70. Padding is in play.

    http://css-tricks.com/box-sizing/

  12. 9 years, 9 months ago Göran Johansson

    I think I got it in place except for my menu.
    The menu itself goes to the right side?
    and my BG-image is just on to the left side and not center at all.

    My custom css looks like this at the moment:

    body.layout-full {
        background-color: #ccc
    }
    
    .main-navigation {
    	background: black
    }
    
    body.responsive.layout-full #page-wrapper nav .full-container {
    	/* background: blue */
    }
    
    .layout-full #main-slider {
        margin: 0 auto;
    }
    
    #main {
        margin: 0 auto;
        max-width: 847px
    }
    
    .layout-full #colophon {
        background: black;
        padding: 0
    }
    
    .layout-full #footer-widgets {
        background: black;
        margin: 0 auto
    }
    
    body.responsive.layout-full #page-wrapper #colophon .full-container {
        max-width: 857px;
        padding: 30px
    }
    
    /* Vantage Full Width Layout - Adjust Site Width */
    
    /* body.responsive #page-wrapper {
      max-width: 917px;
    } */
    
    #page-wrapper {
      padding-top: 0px;
    }
    
    /* body{
      background: #000000;
    } */
    
    /* Vantage Menu Background Image */
    
    .main-navigation {
      background-image: url('/wp-content/uploads/2014/12/MenuBG.jpg');
      /*background-size: cover;*/
      background-repeat: no-repeat;
      /*float: center;
      margin: 0;*/
    }
    
    /* Vantage center align the main menu */
    
    .main-navigation ul li a {
    padding-top: 40px;
    padding-bottom: 40px
    padding-right: 0px !important;
    padding-left: 0px !important;
    }
    
    .main-navigation ul {
    font-size: 0;
    text-align: right;
    }
    
    .main-navigation ul li {
    display: inline-block;
    float: none;
    font-size: 10px;
    }
    
    .main-navigation ul ul li { 
    text-align: left;
    }
    
    .main-navigation ul li:hover > a {
    background: 0 !important;
    color: #FFFFFF !important;
    }
    
  13. 9 years, 9 months ago Andrew Misplon
    Hi, I Work Here

    Please can you try testing just with the CSS I sent through and work your way out from there. The CSS I sent is working in my demo. So save the CSS you have now in spare file and just insert mine. Try going from there.

  14. 9 years, 9 months ago Göran Johansson

    Except for the menu it worked straight out of the box.
    I have modified it accordingly and now it seems to work perfectly!

    BIG Thank you!

  15. 9 years, 9 months ago Andrew Misplon
    Hi, I Work Here

    Glad to hear you’re making progress.

    What are you wanting the menu to do?

    How I’ve set it up is:

    This is handling the menu background color.

    .main-navigation {
    	background: red
    }
    

    And this is handling the color of the menu outside of the constrained menu but on the same line.

    body.responsive.layout-full #page-wrapper nav .full-container {
    	background: blue
    }
    
  16. 9 years, 9 months ago Göran Johansson

    The menu works fine but I had to limit the width on it.
    So now with this code it works just fine.
    I’m working on other things now so I might just come back with a new thread :)

    .main-navigation {
    	background: black;
    }
    
    body.responsive.layout-full #page-wrapper nav .full-container {
    	background-image: url('/wp-content/uploads/2014/12/MenuBG.jpg');
        background-repeat: no-repeat;
        background-size: cover;
        max-width: 917px;
    }
    
  17. 9 years, 9 months ago Andrew Misplon
    Hi, I Work Here

    Super. For sure, let us know if you get stuck further down the line.

  18. 9 years, 9 months ago Göran Johansson

    Follow-up question:
    On the other pages where I don’t have the slider the background is something else.
    What tag can I use to alter the background where the slider does not exist?

  19. 9 years, 9 months ago Andrew Misplon
    Hi, I Work Here

    Have you since made progress here? It looks good when I view other pages on your site. Can you send me a link to the page you’re looking at if this isn’t resolved. Thanks.

  20. 9 years, 9 months ago Göran Johansson

    I solved it.
    The problem was my bg-image and not something with the theme itself.

    Thanks for your quick support!

  21. 9 years, 8 months ago Andrew Misplon
    Hi, I Work Here

    Super, glad to hear you sorted that out.

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More