Best way to Caption Images?

Discussion in 'HTML & Website Design' started by mcdeere02, Aug 6, 2009.

Thread Status:
Not open for further replies.
  1. #1
    Hi guys,

    Was thinking what the best and cleanest way to add caption text to images is.
    Discussion really is between: tables, css, and scripting.

    What have you found the best to work with?
     
    mcdeere02, Aug 6, 2009 IP
  2. webopius

    webopius Peon

    Messages:
    18
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hi,

    On my sites, I caption using css and a <div> or <span> to wrap the image and caption. Then use a <span> to wrap the caption itself.

    Something like this:

    <span class="wrapper">
    <img src="the image url" />
    <span class="caption" >Some caption text</span>
    </span>

    What I do with the CSS is make the 'wrapper' position:relative, then I make the 'caption' position:absolute with a bottom of 0px to force the caption to appear below the image. This format also allows you to play around with the caption's positioning within the 'wrapper' by changing the CSS position attributes of the caption.

    If this doesn't make sense, just ask and I'll send you an example you can copy.
     
    webopius, Aug 6, 2009 IP
Thread Status:
Not open for further replies.