• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Images with caption overflowing content area

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Images with caption overflowing content area

This topic is: not resolved

Tagged: captions, css, image

  • This topic has 3 replies, 2 voices, and was last updated 7 years, 6 months ago by Doug Edgington.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • March 9, 2016 at 7:01 am #180994
    senordeer
    Member

    I am using Sample full width child theme, so it's an old theme, not HTML5. If I add a caption to an image in a blog post, it overflows the content area. Example, first image in post here:

    Heart-shaped Dark Chocolate Covered Almond Butter Bars

    I have tried all combinations of CSS max-width, etc., nothing seems to work. Images without caption are set to max-width: 100%, height: auto and fit into content area (set to 660px) just fine, but I cannot get my images with captions to fit into content area. Thanks in advance!

    http://dev.wordpresstest.net/2016/03/03/heart-shaped-dark-chocolate-covered-almond-butter-bars/
    March 9, 2016 at 8:20 am #181000
    Doug Edgington
    Member

    Not familiar with this theme, but it appears to be an older fixed layout. The content area is 600px ( excluding the 10px of padding ), and your caption is 770px all together. So it is too large for the content area. Basically, you have 660px to work with. So you could try using an image that is 648px ( 660px minus 12px for padding and border = 648px ).

    If you are wanting to force it to always fit via CSS, you could try something like the example below.

    .wp-caption {
    	max-width: 100%;
    	-webkit-box-sizing: border-box;
    	-moz-box-sizing:    border-box;
    	box-sizing:         border-box;
    }
    
    .wp-caption img {
    	max-width: 100%;
    	height: auto;
    }

    Doug Edgington
    http://www.dougedgington.com

    March 9, 2016 at 8:52 am #181003
    senordeer
    Member

    Doug that CSS worked perfectly, I didn't want to have to size each image before uploading. I was missing the webkit and moz box sizing on the CSS I had before, thanks again this is resolved.

    March 9, 2016 at 9:59 am #181016
    Doug Edgington
    Member

    No problem.


    Doug Edgington
    http://www.dougedgington.com

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble