1. PROMO Subscribe our All Access Pass @ 75% OFF & access all our 16+ premium Divi extensions: Divi Block Pro, Carousel Toolkit, etc.LEARN MORE
Dismiss Notice
NEW Divi.Help Pro Carousel AI Toolkit - Magically turn your Divi design into carousel, simply by using our online toolkit. No plugins needed. Now it works with Divi 5 as well!Try our carousel AI toolkit
BEST Divi Block - A revolutionary drag & drop tool to easily mix & match 960+ premade blocks (Light & Dark) to kick start your Divi site design. Special module designs are included as well. Also newly added AI generator & color. Now it works with Divi 5 as well!
Learn More About Divi BlockFree Version ~ 340+ Free Blocks

Solved Sidebar width issue: Content should be wider

Discussion in 'Free Divi Community Forum' started by chrisF, Jun 3, 2024.

  1. chrisF

    chrisF New Member

    Hello

    I've tried a lot of different CSS to change the width and padding but nothing works. There is a lot of space on the right side of the widget area, sidebar, the widgets are not 100% of the sidebar.

    upload_2024-6-3_18-6-1.png

    upload_2024-6-3_18-7-41.png

    I'd llke it to be in this space here with less padding on the right. I've inspected the element and tried to edit it with various code:

    /* Adjusting the sidebar to fill the space */
    #sidebar {
    width: 100%; /* Ensure the sidebar takes up the full width of its container */
    padding: 0; /* Remove any padding */
    margin: 0; /* Remove any margin */
    }


    and then I tried this:
    /* Target the sidebar container */
    #sidebar {
    width: 100%; /* Ensure the sidebar takes up the full width of its container */
    padding: 0; /* Remove any padding */
    margin: 0; /* Remove any margin */
    }
    /* Target the widget elements inside the sidebar */
    #sidebar .et_pb_widget {
    width: 100%; /* Ensure each widget takes up the full width of the sidebar */
    padding: 0; /* Remove any padding */
    margin: 0; /* Remove any margin */
    float: none; /* Prevent floating */
    }


    and so on...

    /* Ensure the main container takes the full width */
    #content-area.clearfix {
    display: flex;
    flex-direction: row;
    width: 100%;
    padding: 0;
    margin: 0;
    }
    /* Ensure the sidebar takes the full width of its parent */
    #sidebar {
    flex: 1; /* Allows the sidebar to take available space */
    padding: 0;
    margin: 0;
    }
    /* Ensure each widget inside the sidebar takes the full width */
    #sidebar .et_pb_widget {
    width: 100%;
    padding: 0;
    margin: 0;
    float: none;
    }



    but still it is just not working in the way I would like, I just want to reduce the huge gap on the right hand side for blog posts only.
     
    1. PRO MEMBER PERKS Divi Ultimate Archive Plugin - Beautify your Divi archive / category page with 15 different premade blog designs:Learn More
  2. Divi Booster

    Divi Booster Divi Expert

    Hi Chris,

    I think the main thing that will be stopping your code from working is that Divi sets a "max-width" on the content container, which will constrain the total width of the content even if the "width" is set to 100%. You can control this max width in the customizer, but it's a site-wide value, so CSS is probably your best option to apply it just to blog widths.

    Once you set a new, larger max width, both the blog content and sidebar will be expanded. Normally they have a roughly 80% / 20% split of the space, but if you want to keep the blog content at its current size you'll need to adjust this split and also add some padding to the left of the blog content to bring it back in from the side.

    Here's an example of the code to do this, though you'll probably want to tweak the values to your liking:

    Code:
    Log In or Sign Up to view this code.
    Also note that I tested this against the default Divi blog post layout - you may want to remove some (or all) of your current CSS initially to avoid any conflicts and then add it back in as needed.
     
  3. chrisF

    chrisF New Member

    Thank you - this has worked!
     
    1. PRO MEMBER PERKS Divi Login Customizer Plugin - Instantly beautify your Wordpress login page with 6 premade designs:Learn More
  4. Divi Booster

    Divi Booster Divi Expert

    Great! You're welcome, Chris :)