I'm trying to make the <figcaption>
element render scrollbars when it's content's width exceeds the width of an <img>
sibling, typically when the content is a long URL or a very long word.
The following code is adapted from this answer and it works with IE 11 and Edge 15 but not in Firefox 55 and Chrome 61:
* {
outline: 1px solid red;
}
figure {
display: table;
max-width: 100%;
}
figure img {
vertical-align: top;
}
figure figcaption {
display: table-caption;
caption-side: bottom;
overflow: auto;
}
<figure>
<img src="//via.placeholder.com/220x100" alt="">
<figcaption>Long word in figure caption Lopadotemachoselachogaleokranioleipsanodrimhypotrimmatosilphioparaomelitokatak</figcaption>
</figure>