Skip to content

Instantly share code, notes, and snippets.

@MoritzBuetzer
Created May 7, 2014 06:26
Show Gist options
  • Select an option

  • Save MoritzBuetzer/4c89d9da1e15745cf2b0 to your computer and use it in GitHub Desktop.

Select an option

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
Copy Markdown

Perfecto :) Thanks.

@fabiodisconzi

Copy link
Copy Markdown

Really helpful! I apply it to Unify bootstrap theme.

@Porges

Porges commented Sep 30, 2022

Copy link
Copy Markdown

aah this is good

@pbarney

pbarney commented Oct 8, 2024

Copy link
Copy Markdown

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