Skip to content
TheChatArchiveThe Chat Archive
DeepSeekdeepseek-v3-0324· DeepSeekHugging 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 chatgpt-4o-latest-20250326’s answer.
  1. User

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

  2. DeepSeek Assistant

    To ensure the caption under a photo in WordPress Elementor is no wider than the photo itself, follow these steps:

    Method 1: Using Elementor’s Built-in Caption

    1. Add an Image Widget

      • Drag and drop the Image widget into your Elementor section.
      • Upload or select your image.
    2. Enable Caption

      • In the Image Settings panel, go to the Content tab.
      • Under Caption, select Attachment Caption (if using WordPress media library captions) or enter a custom caption in the Custom Caption field.
    3. Adjust Caption Width

      • The caption will automatically inherit the width of the image if it’s set to Inline (default behavior).
      • If the caption is wider, check if the image has a maximum width set (e.g., max-width: 100%).

    Method 2: Manual Caption (Using Text Widget)

    If you’re adding a caption manually (e.g., with a Text Editor widget below the image):

    1. Wrap the Image and Caption in a Container

      • Add a Container or Inner Section widget.
      • Place the Image widget and a Text Editor widget (for the caption) inside it.
    2. Set Maximum Width for the Container

      • Select the Container or Inner Section.
      • Go to Advanced > Custom CSS and add:
        max-width: fit-content;
        margin: 0 auto; /* Optional: Centers the container */
        
      • Alternatively, set a fixed width matching the image dimensions.
    3. Style the Caption

      • Select the Text Editor widget (caption).
      • In the Advanced tab, ensure:
        • Width is set to 100% (default).
        • Padding and Margin are adjusted if needed.

    Method 3: Custom CSS (For Advanced Users)

    If the caption still overflows, add this CSS in Elementor > Custom CSS or WordPress Customizer:

    .elementor-image-caption {
        max-width: 100%;
        display: inline-block;
    }
    

    Or, if using a custom container:

    .your-container-class .elementor-widget-text-editor {
        width: 100%;
        max-width: 100%;
    }
    

    Why This Happens

    • Captions may stretch if the parent container is wider than the image.
    • Some themes add extra padding/margin to captions.

    Verification

    • Preview the page and inspect the caption with browser tools (right-click > Inspect).
    • Ensure no conflicting CSS is forcing a wider layout.

    This should keep your caption neatly aligned with the image width. Let me know if you need further adjustments! 🚀

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