OZONE Asylum
Forums
XML - XSL - XSLT - XHTML - CSS - DOM
Contrain DIV Width to IMG Width
This page's ID:
11052
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
Here is what i understood: You want the caption width to be the same as the image width? right. And the images are all a different size? So you actually want the caption size to grow when the picture(width) is bigger? And you want the caption to be smaller when the picture is smaller? Then the above trick should work. This is the theory: The outer (caption) has no size defined so it sets the size to auto or the "defined by content" the content is another div with the picture on it. This inner (content) div has also no size defined and is thus "defined by content" which is your image. So the image defines it's own div and the caption div. Now the only thing you need to do is playing with the margins and padding to get both layers right. The image div should fit into the caption div padding/margin. Then copy/past the two div code as many as you need, copy the pictures and text in it and you are ready to rock ;) But this is theory... i haven tried this trick yet . But i played with the above link and that one reacts on the size of content so it should work. I'am very sorry if did not understand the question right , but i learned some good things on the way. Thanks for that __________________________________________ "Art has to be forgotten. Beauty must be realized." Piet Mondriaan
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »