1
votes

I am trying to display in a ColorBox popup, a caption AND a title (caption from image 'alt' attribute and title from image 'title' attribute). The colorbox is opened when an image is clicked.

Here is an example of what I want to do.

screenshot

The img will be something like the following.

<img typeof="foaf:Image" src="http://localhost:4444/img.jpg" width="336"   height="254" alt="LEGEND / CAPTION balbalblalblalba balbalblalblalba balbalblalblalba" title="TITLE balbalblalblalba balbalblalblalba balbalblalblalba" class="">

Do you have any idea of how can I do that?

1
There are a lots of way that you can do that. You can use :after,:before and jquery for clicking part.Alex

1 Answers

2
votes

You can use a div to which you set the background your image

div
{
    height: 616px;
    background:url(http://i.stack.imgur.com/eXA9b.jpg)
}

then using the :before and :after selectors you add your text to your desired postion

div::before { 
    content: "Title"
    position: relative;
    top: 100px;
    background-color: white;
    opacity: 0.5;
}

div::after { 
    content: "Caption";
    position: relative;
    top: 400px;
    background-color: white;
    opacity: 0.5;
}

change the top to get the text to your desired position and the opacity to get the opacity you need

full fiddle here http://jsfiddle.net/rsm07fdw/