Skip to content

Instantly share code, notes, and snippets.

@MoritzBuetzer
Created May 7, 2014 06:26
Show Gist options
  • Save MoritzBuetzer/4c89d9da1e15745cf2b0 to your computer and use it in GitHub Desktop.
Save MoritzBuetzer/4c89d9da1e15745cf2b0 to your computer and use it in GitHub Desktop.
figcaption restricted to the width of a responsive image
figure {
padding: 5px;
display: table;
}
figure img {
display: block;
}
figcaption {
display: table-caption;
caption-side: bottom;
}
@BradCoffield
Copy link

Perfecto :) Thanks.

@fabiodisconzi
Copy link

Really helpful! I apply it to Unify bootstrap theme.

@Porges
Copy link

Porges commented Sep 30, 2022

aah this is good

@pbarney
Copy link

pbarney commented Oct 8, 2024

Now try to get the caption centered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment