Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8702185
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:35:24+00:00 2026-06-13T02:35:24+00:00

I hit a need to auto shrink my text wrapper width below image. for

  • 0

I hit a need to auto shrink my text wrapper width below image.

for example:

<figure>
    <img src="mypicture.jpg" />
    <figcaption>
        This is a long description.This is a long description.This is a long description.
    </figcaption>
</figure>

Now I want to have a border around img and figcaption, because I have lots of images with different width. So I want to auto shrink the figcaption width to fit the image’s width. That is if I have a image with width 100px, then I want my figcaption 100px too.

Can you tell me if I can do this without js, just use pure html and css?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T02:35:25+00:00Added an answer on June 13, 2026 at 2:35 am

    It does need some tricks.
    You can set the container display to table and give it a small width. It will auto align its content width (like a table).

    Here is a example

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a .NET webservice which I need to hit asynchronously from the jQuery
I am working on a blackberry application in which I need to hit a
I need to perform efficient hit testing against a (potentially huge) number of components
I need to log some data when some functions are hit, both at the
I have hit a real problem. I need to do some Kmeans clustering for
Hi I want to hit one URL that show an image in half page
If I connect to an inexistent socket with pyzmq I need to hit CTRL_C
i have a problem here. I need it so if there is no text
I have SQL Server Express on my laptop. I only need to hit it
SOLVED Look at the comments below <head> <script src=http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js></script> <script type=text/javascript> $(document).ready(function() { $('#playlistToggle').click(function(event)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.