WordPress.org

Make WordPress Core

Opened 6 months ago

Closed 6 months ago

Last modified 6 months 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:

Description

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}

to

.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.

Thanks,
Thomas

Change History (3)

#1 @subrataemfluence
6 months 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
6 months 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
6 months 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.