In WordPress Elementor, how to make the caption under a photo no wider than the photo.
- User
In WordPress Elementor, how to make the caption under a photo no wider than the photo.
- 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
- Drag an Image Widget into a column or section.
- Add your image.
- To add a caption:
- Drag a Text Editor Widget below the image.
- Type your caption.
- Select both the Image and Text Editor widgets, right-click > Group into Inner Section.
- Now, select the Inner Section settings:
- Under Layout > Width, set to
Inline (auto)orCustom. - Adjust alignment or margins as needed.
- Under Layout > Width, set to
- 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:
- Go to the Image Widget’s Advanced tab.
- Add a CSS class like
image-with-caption. - 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
%oremunits instead of fixedpx. - 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.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.