Skip to content
TheChatArchiveThe Chat Archive
chatgpt-4o-latest-20250326· OpenAIHugging Face LMArena Human Preference 140K

In WordPress Elementor, how to make the caption under a photo no wider than the photo.

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with DeepSeekdeepseek-v3-0324’s answer.
  1. User

    In WordPress Elementor, how to make the caption under a photo no wider than the photo.

  2. Assistant

    To make the caption under a photo in Elementor (WordPress) no wider than the photo itself, you'll want to ensure that the caption container is limited to the width of the image.

    Here’s how you can achieve that:


    ✅ Option 1: Use Inner Section or Column Wrapping

    1. Drag an Image Widget into a column or section.
    2. Add your image.
    3. To add a caption:
      • Drag a Text Editor Widget below the image.
      • Type your caption.
    4. Select both the Image and Text Editor widgets, right-click > Group into Inner Section.
    5. Now, select the Inner Section settings:
      • Under Layout > Width, set to Inline (auto) or Custom.
      • Adjust alignment or margins as needed.
    6. Optional: Set a Max Width in pixels or `%** matching the image width (e.g. 300px).

    ✅ This method ensures the caption sticks to the image's width even if it's responsive.


    ✅ Option 2: Custom CSS

    If you prefer using CSS (works best when using the Default caption feature or need more control):

    A. Add an Image with Caption:

    • Use the Image Widget, set Image Caption to “Caption Below”.
    • Enter the caption text from the WordPress Media Library or the "Image Caption" field.

    B. Add Custom CSS:

    1. Go to the Image Widget’s Advanced tab.
    2. Add a CSS class like image-with-caption.
    3. Now go to Site Settings > Custom CSS, or use a plugin like Simple Custom CSS, and add:
    .image-with-caption .wp-caption {
        display: inline-block;
        text-align: center;
    }
    
    .image-with-caption .wp-caption-text {
        width: 100%;
        display: block;
    }
    

    This makes the caption container inline with the image, so it won't stretch beyond the image’s width.


    ✅ Bonus Tip - Responsive Design

    To make it work well on mobile:

    • Use % or em units instead of fixed px.
    • Add media queries if needed to adjust max-width.

    Let me know if you're using any specific Elementor add-ons (like Essential Addons or Elementor Pro), because some have dedicated widgets that handle image captions better with more control.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.