HighDots Forums  

Image Captions

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Image Captions in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Chris Leipold
 
Posts: n/a

Default Image Captions - 12-10-2004 , 03:39 AM






Hi,

I habe a page with an image with variable width. I need a caption below
the image with the same width as the image.
See http://www.dietzk.de/test/ - the first example is what I need.
This first example works fine as long as I know the image width. But if
I don't know it (and later I won't) it does not.

I tried examples 2 and 3. But they don't work :-(

Any ideas?

Thanks Chris

Reply With Quote
  #2  
Old   
Johannes Koch
 
Posts: n/a

Default Re: Image Captions - 12-10-2004 , 04:58 AM






Chris Leipold wrote:

Quote:
I habe a page with an image with variable width. I need a caption below
the image with the same width as the image.
See http://www.dietzk.de/test/ - the first example is what I need.
This first example works fine as long as I know the image width. But if
I don't know it (and later I won't) it does not.
You may try to read the image dimensions on the server-side and then put
them into HTML/inline CSS code.
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)


Reply With Quote
  #3  
Old   
Spartanicus
 
Posts: n/a

Default Re: Image Captions - 12-10-2004 , 06:35 AM



Chris Leipold <cleipold (AT) dietzk (DOT) de> wrote:

Quote:
I habe a page with an image with variable width. I need a caption below
the image with the same width as the image.
See http://www.dietzk.de/test/ - the first example is what I need.
This first example works fine as long as I know the image width. But if
I don't know it (and later I won't) it does not.
span{display:inline-table;width:2em}

<span>
<img src="img.jpg" alt="something suitable">
caption caption caption caption caption caption
</span>

Won't work in Mozilla or IE. Or:

span{display:table;width:2em}

<span>
<img src="img.jpg" alt="something suitable">
caption caption caption caption caption caption
</span>

Won't work in IE and forces the img/caption combo to block. Or:

http://www.spartanicus.utvinternet.i...d_to_image.htm

Works in all three, but the img/caption combo renders as block in
Mozilla.

Take your pick :-)

--
Spartanicus


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.