Title: Container width issues for sidebar element
Last modified: June 10, 2021

---

# Container width issues for sidebar element

 *  Resolved [solsalute](https://wordpress.org/support/users/solsalute/)
 * (@solsalute)
 * [4 years, 12 months ago](https://wordpress.org/support/topic/container-width-issues-for-sidebar-element/)
 * I’ve created a sidebar via a block element and it works great, now I’m just trying
   to style it by adding a background color behind my photo and introduction, I 
   did so with a container and set the width to 300px (width of my sidebar). All
   looks great except the photo and text now bleed off the right. What am I doing
   wrong that is keeping the background of the container smaller than the photo/
   headline blocks inside it? I’ve tried no constraining the width of the container
   but same thing still happens.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcontainer-width-issues-for-sidebar-element%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 7 replies - 1 through 7 (of 7 total)

 *  [Elvin](https://wordpress.org/support/users/ejcabquina/)
 * (@ejcabquina)
 * [4 years, 12 months ago](https://wordpress.org/support/topic/container-width-issues-for-sidebar-element/#post-14544190)
 * Hi there,
 * It’s because your containers have conflicting min-width and max-width.
 * Your outside container was set to max-width of 300px while your inside container
   was set to min-width:380px. The min-width causes the overflow because 380px is
   greater than 300px.
 * I suggest not adding these values and let the containers flow naturally.
 *  Thread Starter [solsalute](https://wordpress.org/support/users/solsalute/)
 * (@solsalute)
 * [4 years, 12 months ago](https://wordpress.org/support/topic/container-width-issues-for-sidebar-element/#post-14545076)
 * I don’t see 380 pixels anywhere, I have it all set at 300 where I can see.
    I
   removed the constrained widths on everything to test it and it kept overflowing
   anyway. Now I have it set at 300 for both containers.
 *  Plugin Author [Tom](https://wordpress.org/support/users/edge22/)
 * (@edge22)
 * [4 years, 12 months ago](https://wordpress.org/support/topic/container-width-issues-for-sidebar-element/#post-14546530)
 * Hi there,
 * I’m seeing this custom CSS added:
 *     ```
       @media only screen and (min-width: 1105px) {
           .right-sidebar .sidebar, .right-sidebar .sidebar .gb-inside-container {
               min-width: 380px;
           }
       }
       ```
   
 * It could be in “Customize > Additional CSS”, maybe?
 * That’s what’s causing the overflow.
 * Let us know 🙂
 *  Thread Starter [solsalute](https://wordpress.org/support/users/solsalute/)
 * (@solsalute)
 * [4 years, 12 months ago](https://wordpress.org/support/topic/container-width-issues-for-sidebar-element/#post-14547339)
 * Ok thanks!! Mediavine added that to make the sidebar wide enough for ads, I forgot.
   
   But I can’t manage to make the overflow stop, I realize this is a simple simple
   solution but for some reason I am failing at the simple math. I made both containers
   full width to avoid any conflicting values but am leaving the CSS as is to not
   mess with their ad fix…what am I doing wrong?
 *  Plugin Author [Tom](https://wordpress.org/support/users/edge22/)
 * (@edge22)
 * [4 years, 12 months ago](https://wordpress.org/support/topic/container-width-issues-for-sidebar-element/#post-14549984)
 * What happens if you remove the 40px of padding from the outer GenerateBlocks 
   Container in the sidebar?
 *  Thread Starter [solsalute](https://wordpress.org/support/users/solsalute/)
 * (@solsalute)
 * [4 years, 12 months ago](https://wordpress.org/support/topic/container-width-issues-for-sidebar-element/#post-14550608)
 * THANKS!!! That was it!!
 *  Plugin Author [Tom](https://wordpress.org/support/users/edge22/)
 * (@edge22)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/container-width-issues-for-sidebar-element/#post-14551974)
 * No problem!

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Container width issues for sidebar element’ is closed to new replies.

 * ![](https://ps.w.org/generateblocks/assets/icon.svg?rev=3239461)
 * [GenerateBlocks](https://wordpress.org/plugins/generateblocks/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/generateblocks/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/generateblocks/)
 * [Active Topics](https://wordpress.org/support/plugin/generateblocks/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/generateblocks/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/generateblocks/reviews/)

 * 7 replies
 * 3 participants
 * Last reply from: [Tom](https://wordpress.org/support/users/edge22/)
 * Last activity: [4 years, 11 months ago](https://wordpress.org/support/topic/container-width-issues-for-sidebar-element/#post-14551974)
 * Status: resolved