[wp-trac] [WordPress Trac] #42700: Figure captions not inheriting max-width from figures
WordPress Trac
noreply at wordpress.org
Mon Dec 11 02:04:37 UTC 2017
#42700: Figure captions not inheriting max-width from figures
-------------------------------------------------+-------------------------
Reporter: bahead | Owner: desrosj
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: Awaiting
Component: Media | Review
Severity: normal | Version: 4.9
Keywords: needs-patch needs-screenshots | Resolution:
reporter-feedback | Focuses:
-------------------------------------------------+-------------------------
Changes (by desrosj):
* keywords: needs-patch needs-screenshots => needs-patch needs-screenshots
reporter-feedback
Old description:
> This is a follow-up to #33981.
>
> The "width" attribute in figure has been changed to "max-width". However,
> while figcaption would inherit "width", it does not inherit "max-width".
> As a result, a figcaption that exceeds the max-width attribute in figure
> breaks left/right alignment of the figure (i.e., the caption does not
> wrap under the image). Proposed fix is to modify media.php to insert max-
> width into figcaption as well as in figure.
New description:
This is a follow-up to #33981.
The "width" attribute in figure has been changed to "max-width". However,
while figcaption would inherit "width", it does not inherit "max-width".
As a result, a figcaption that exceeds the max-width attribute in figure
breaks left/right alignment of the figure (i.e., the caption does not wrap
under the image). Proposed fix is to modify media.php to insert max-width
into figcaption as well as in figure.
I am attaching some screenshots of what I am seeing when testing in Twenty
Seventeen.
--
Comment:
Hi @bahead, welcome to Trac! Thanks for making the ticket.
I tried to reproduce the issue you described, but I could not get the text
to bleed out of the `<figcaption>` element. Can you please provide more
details to reproduce? If you could attach some screenshots, that would
help as well.
I tried with the default Twenty Seventeen theme, the Underscores theme,
and with no theme styles at all (all in Firefox). Even though the `max-
width` property was not actually inherited, the text seemed to respect the
`<figures>`'s `max-width` each time.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/42700#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list