Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#45616 closed defect (bug) (invalid)

Image captions don't display in a line but just one word in a line

Reported by: stramm Owned by:
Milestone: Priority: normal
Severity: minor Version:
Component: Media Keywords:
Focuses: ui Cc:


When adding an image with description to a post (in Gutenberg) and aligning it left or right, setting medium size and a link to the media, the caption (text between <figcaption>text</figcaption>) renders on the final page in all browsers I've tested not in one line using the width of the entire image above but each word of the caption uses one separarte line.

I tried to modify /wp-includes/css/dist/block-libraray/style.min.css and changed

.wp-block-image .aligncenter>figcaption,.wp-block-image .alignleft>figcaption,.wp-block-image .alignright>figcaption,.wp-block-image.is-resized>figcaption{display:table-caption;caption-side:bottom}


.wp-block-image .aligncenter>figcaption,.wp-block-image .alignleft>figcaption,.wp-block-image .alignright>figcaption,.wp-block-image.is-resized>figcaption{display:table-caption;caption-side:bottom;width:100%}

That fixed the problem for me if I add text next to the image. If however no text gets added, the caption spans over the entire site width and not only the image size.


Change History (3)

#1 @subrataemfluence
2 years ago

  • Keywords reporter-feedback added

Welcome to Trac and thanks for opening the ticket!

Could not reproduce the issue. I tested a long caption with both twentyseventeen and twentynineteen.

Probably your theme has something to do. Can you please try with above themes and see whether the issue still persists?

#2 @stramm
2 years ago

  • Resolution set to invalid
  • Status changed from new to closed

OK, thanks for the hint. When I switch to twentynineteen the caption is working as expected. Please excuse the hazzle I've caused you.

#3 @SergeyBiryukov
2 years ago

  • Component changed from Formatting to Media
  • Focuses ui added
  • Keywords reporter-feedback removed
  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.