Title: WordPress Image Galleries width
Last modified: December 16, 2024

---

# WordPress Image Galleries width

 *  [hbee](https://wordpress.org/support/users/heatherbodlak/)
 * (@heatherbodlak)
 * [1 year, 5 months ago](https://wordpress.org/support/topic/wordpress-image-galleries-width/)
 * Hello,
 * I am trying to figure out why the following is happening:
 * I am using the default template for Blog entries, and the text and featured image
   appear just fine, centerd on the page, with margins on either side. But if I 
   create a Gallery and insert it, it extends full width, breaking the layout. It
   doesn’t line up with the entry content, it doesn’t have the same margins to the
   left and right.
 * Example here (we used FooGallery to try and make it more presentable, but you
   can still see that it extends to be full width, when I’d like it to align with
   the Blog content:
 * [https://axober.org/axober-na-feira-de-emprego-45en-carballo/](https://axober.org/axober-na-feira-de-emprego-45en-carballo/)
 * Any help appreciated.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fwordpress-image-galleries-width%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  [Shahin](https://wordpress.org/support/users/skalanter/)
 * (@skalanter)
 * [1 year, 5 months ago](https://wordpress.org/support/topic/wordpress-image-galleries-width/#post-18203115)
 * Hello [@heatherbodlak](https://wordpress.org/support/users/heatherbodlak/),
 * Thank you for reaching out,
 * Please put the CSS below in Customizing > Custom CSS/JS > CSS Code:
 *     ```
       .single .entry-content .foogallery {
           max-width: 1100px;
           margin: 0 auto;
       }
       ```
   
 * Please read this link for more information about the CSS/JS code on the customizer:
   [https://docs.oceanwp.org/article/354-add-custom-css-and-js-to-your-website](https://docs.oceanwp.org/article/354-add-custom-css-and-js-to-your-website).
 * **Note:** If you have any cache plugin or server cache(CDN / Browser Cache and
   Cookies and …), you need to clear its cache contents or disable them to see your
   changes. Also, remember to click on the regenerate all assets file and data in
   Elementor > Tools(if you have Elementor).
 * I hope that helps.
    Best Regards
 *  Thread Starter [hbee](https://wordpress.org/support/users/heatherbodlak/)
 * (@heatherbodlak)
 * [1 year, 5 months ago](https://wordpress.org/support/topic/wordpress-image-galleries-width/#post-18203640)
 * Hi, yes, that works, thanks! But is there a way to apply that to the regualr 
   WordPress Galleries too?
 * —-
 * edited to add: I think i figured it out, same CSS as you provided, but for .gallery
 *     ```wp-block-code
       .gallery {    max-width: 1100px;    margin: 0 auto;}
       ```
   
 * Thanks again.
    -  This reply was modified 1 year, 5 months ago by [hbee](https://wordpress.org/support/users/heatherbodlak/).
 *  [Shahin](https://wordpress.org/support/users/skalanter/)
 * (@skalanter)
 * [1 year, 5 months ago](https://wordpress.org/support/topic/wordpress-image-galleries-width/#post-18205498)
 * Hello [@heatherbodlak](https://wordpress.org/support/users/heatherbodlak/),
 * Thank you for reaching out,
 * If you created a single post with the Gutenberg editor, placing all items on 
   the page without wrapping them in a container might cause this issue. Then you
   would need to write custom CSS to fix it.
 * To prevent this issue, place your desired content inside a section or column 
   to maintain the content wrapper.[https://ibb.co/N6kjQf7](https://ibb.co/N6kjQf7)
 * Best Regards
 *  Thread Starter [hbee](https://wordpress.org/support/users/heatherbodlak/)
 * (@heatherbodlak)
 * [1 year, 5 months ago](https://wordpress.org/support/topic/wordpress-image-galleries-width/#post-18206410)
 * ah yes, that makes sense I’m afraid we are using “classic editor” though, so 
   that’s probably the problem.
 * Unfortunately I can’t switch to Gutenberg because the people who update the blog
   would be very confused 😅. They are too used to the classic editor.

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

The topic ‘WordPress Image Galleries width’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/oceanwp/4.1.6/screenshot.png)
 * OceanWP
 * [Support Threads](https://wordpress.org/support/theme/oceanwp/)
 * [Active Topics](https://wordpress.org/support/theme/oceanwp/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/oceanwp/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/oceanwp/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [hbee](https://wordpress.org/support/users/heatherbodlak/)
 * Last activity: [1 year, 5 months ago](https://wordpress.org/support/topic/wordpress-image-galleries-width/#post-18206410)
 * Status: not resolved