• Hi,

    i use latest WP with GeneratePress Theme. I actived left sidebar. I want to have the left sidebar and the mainpage with same height. Actual i got a shorter left sidebar if the mainpage is longer and if the mainpage is smaller than the left sidebar, the main page is shown shorter.

    Any idea to make both, left sidebar and mainpage, always in the same height? I tried with custom css and different approaches on different divs and aside blocks but without success.

    thx

Viewing 15 replies - 1 through 15 (of 27 total)
  • Hi there,

    can you share a link to your site where I can see the issue?

    Thread Starter sunghost

    (@sunghost)

    Hi David,

    sorry its local testing. But its a default Theme with left sidebar configured, in which is the menu with submenus.

    Hope that helps .

    You could try this CSS:

    #primary, #main, .inside-left-sidebar {
        min-height: 100%;
    } 
    #main, .inside-left-sidebar {
       background-color: #f00;
    }

    change the background-color: #f00; to match your sidebar and content.

    Thread Starter sunghost

    (@sunghost)

    Thx,

    but that didnt work. The content didnt grow with the height. The color is no option because i want to have blocks.

    ying

    (@yingscarlett)

    Can you link us to the page in question?

    Thread Starter sunghost

    (@sunghost)

    Hi ying,

    sorry its local for testing. But i use default Theme with left sidebar and a main menu in left sidebar and a second custom text block.

    ying

    (@yingscarlett)

    Are you using float or flexbox as the strcutre? Check customizer > general. if it’s float, change it to flexbox.

    Let me know if this helps!

    Thread Starter sunghost

    (@sunghost)

    I do not have this option under customizer -> general. i only have Icon-Type and Underline Links.

    Hi there,

    It’s hard to assess the site, and why the provided custom code isn’t working without seeing the site live. Would you be able to host the site on a staging site so we can see the issue and help appropriately?

    Thread Starter sunghost

    (@sunghost)

    [quote]

    Are you using float or flexbox as the strcutre? Check customizer > general. if it’s float, change it to flexbox.

    [/quote]

    Its flex, the container bevor which is over left sidebar and content has the class site-conten and the id=content. This style is display: flex.

    Hope that helps.

    ying

    (@yingscarlett)

    Thanks for confirming it’s using flexbox. In this case, the CSS should work. However, there might be other CSS from plugins or other places interfere with it, we will have to see the site in question to determine what is the cause.

    Thread Starter sunghost

    (@sunghost)

    I got a testsite, see https://7i.se/V I hope that helps a lot.

    What do you think?

    • This reply was modified 1 year, 1 month ago by sunghost.
    ying

    (@yingscarlett)

    As you can see the left sidebar is the same length as the content area: https://app.screencast.com/7h1Thufwyz8Hi

    However, do you want the last widget to extend its white space to fill the entire sidebar?

    If so, try adding this CSS as well:

    @media(min-width:769px){
    .inside-left-sidebar .widget:last-child {
        flex-grow: 1;
        margin-bottom: 20px;
    }
    
    .separate-containers .inside-left-sidebar {
        display: flex;
        flex-direction: column;
    }
    
    div#left-sidebar {
        margin-bottom: 20px;
    }
    }
    Thread Starter sunghost

    (@sunghost)

    Hi,

    oh sorry if described it the wrong way. Of course, the last widget should be the same height as the content. And that on every side and in the other way to, so if the sidebar is heigher than the content.

    ying

    (@yingscarlett)

    Does the CSS work?

Viewing 15 replies - 1 through 15 (of 27 total)
  • The topic ‘Left Sidebar and Main same height’ is closed to new replies.